Segmented items allow the user to select a single option from a group using a button-like control.
Ready
Examples
Basic
A Segmented Item is designed to be used within a Segmented Group . When a Segmented Item has focus, the arrow keys can be used to change the selected option.
You can omit button labels and use icons instead. Make sure to set a label attribute on each icon so screen readers will announce each option correctly.
Note: You only need to import a web component once in your code, as it registers itself globally when defined, allowing you to use it anywhere within your application without needing to re-import it each time you want to use the component.
This component is still in development and cannot be imported at this time.
Slots
Name
Description
(default)
The segmented-item button's label.
prefix
A presentational prefix icon or similar element.
suffix
A presentational suffix icon or similar element.
Properties
Please note, both DOM properties and HTML attributes are shown in the table below. Unless otherwise specified, the property and attribute names are identical.
Property/Attribute
Reflects
Type
Default
value
string
disabled
boolean
false
size
'small' | 'medium' | 'large'
'medium'
pill
boolean
false
Events
React Event
Description
Event Detail
ods-blur
Emitted when the button loses focus.
--
ods-focus
Emitted when the button gains focus.
--
Methods
Name
Description
Arguments
focus()
Sets focus on the segmented-item button.
--
blur()
Removes focus from the segmented-item button.
--
Parts
Name
Description
base
The component's base wrapper.
button
The internal `<button>` element.
button--checked
The internal button element when the segmented-item button is checked.
prefix
The container that wraps the prefix.
label
The container that wraps the segmented-item button's label.