Skip to main content

change

Description

fires when a new segment is selected in the segmented button

Parameters

The callback of the event takes an object with the following parameter:

  • value - (string) an id of the newly selected segment or "" if the value is cleared

Example

<script>
function handleChange({value}) {
console.log(value);
// => id of selected option
}
</script>

<Segmented onchange={handleChange}/>

Details

The handler function receives an object with an id of the newly selected segment.

Related article: Catching the change of the selected segment