Segmented Control
A linear set of 2-3 segments, each of which functions as a mutually exclusive button.
Installation
Install
yarn add @iag/chroma-react-ui.components
Import
import { SegmentedControl } from '@iag/chroma-react-ui.components';
Accessibility
Accessibility documentation(opens in new window)Guidelines
Used to provide 2 to 3 choices with short label contents each using 1-2 words.
Default
Disabled
Valid
Error
Block
This will display block level (stacked) for mobile devices only (xs). Apply the block prop when there are more than 2 selectable options as the component may visual break on smaller devices.
Properties
Name
Description
- classNamestringAdditional CSS classes to be applied
- labelClassNamestringAdditional CSS classes to be applied to the label
- disabledbooleanBoolean indicating if the input is disabled
- errorbooleanBoolean indicating if the input is in an error state
- validbooleanBoolean indicating if the input is in a valid state
- idstringHTML id attribute for the Input
- name*stringHTML name attribute for the input
- onChange*(event: ChangeEvent<HTMLInputElement>, value: string) => voidFunction to be called when the input value changes
- options*IOptions[]An Array of objects { label:string, value:string }
- valuestringThe input value
- blockbooleanset a specific class to render the component stacked in Mobile