Skip to content

Segment.Button

The Segment.Button slot represents a single option within a Segment. It renders a clickable button with a transition.

To create a Segment.Button you need to wrap it in the Segment component and provide a value to it. You must also provide the selected prop to the Segment.Button you wish to be selected by default.

import Segment from '@components/Basic/Segment';
const App = () => {
return (
<>
<Segment>
<Segment.Button selected value="red">red</Segment.Button>
<Segment.Button value="green">green</Segment.Button>
<Segment.Button value="blue">blue</Segment.Button>
</Segment>
</>
);
};
export default App;
Prop NameTypeDefaultDescription
styleJSX.CSSProperties{}Inline styles to apply directly to the component’s root element.
classstring""Additional CSS classes to apply to the component.
valuestringundefinedThe string value the Segment button is associated with.
selectedbooleanfalseSpecify if the Segment button is selected.
disabledbooleanfalseSpecify if the Segment button is disabled.
class-disabledstring""Additional CSS classes to apply to the button when disabled.

You can find examples of how to work with the Segment buttons in the Segment documentation.