Component
SegmentedControl
Render single-select controls with roving keyboard focus and default or pill variants.
Interactive preview
Usage
Import the component entry and start with its smallest complete example.
Import
import { SegmentedControl } from "@chitrank2050/monoline-ui/segmented-control"Basic usage
<SegmentedControl
variant="pill"
size="md"
value={activeType}
onChange={setActiveType}
options={[
{ value: "professional", label: "Professional", badge: 3 },
{ value: "personal", label: "Personal", badge: 3 },
]}
/>Usage guidance
Choose the component for its interaction model and semantics before customizing its appearance.
SegmentedControl suits one choice from a small, stable set of options.
The options are independent toggles, have long labels, or make more sense in a select.
SegmentedControl uses radiogroup and radio semantics with roving tab focus and arrow-key navigation, and the group still needs an accessible label.
This component needs browser JavaScript for state or browser APIs.
API reference
Props, slots, and callbacks available on this component.
Design tokens
Theme variables this component reads for color, spacing, and motion.
Implementation
The source used by the example above, including any state it needs.
import { SegmentedControl } from "@chitrank2050/monoline-ui/segmented-control"
export function ProjectFilter() {
const [type, setType] = useState("professional")
return (
<SegmentedControl
variant="pill"
size="md"
value={type}
onChange={setType}
options={[
{ value: "professional", label: "Professional", badge: 3 },
{ value: "personal", label: "Personal", badge: 3 },
]}
/>
)
}Related documentation
Compare related components or review the package and theme setup.