ComponentsInputs & forms
Segmented Control
A row of options with a pill that slides to the selected one.
Default
"use client";
import { Segment, SegmentedControl } from "@/components/miyuki-ui/segmented-control";
export default function SegmentedControlDemo() {
return (
<SegmentedControl aria-label="Forecast range" defaultSelectedKeys={["week"]}>
<Segment id="day">Day</Segment>
<Segment id="week">Week</Segment>
<Segment id="season">Season</Segment>
</SegmentedControl>
);
}With icons
"use client";
import { ChartColumn, List, MapIcon } from "lucide-react";
import { Segment, SegmentedControl } from "@/components/miyuki-ui/segmented-control";
export default function SegmentedControlIconsDemo() {
return (
<SegmentedControl aria-label="View" defaultSelectedKeys={["map"]}>
<Segment id="list">
<List aria-hidden="true" />
List
</Segment>
<Segment id="map">
<MapIcon aria-hidden="true" />
Map
</Segment>
<Segment id="chart">
<ChartColumn aria-hidden="true" />
Chart
</Segment>
</SegmentedControl>
);
}Install
npx shadcn@latest add @miyuki-ui/segmented-controlThis needs the @miyuki-ui registry in your components.json. See Using the shadcn CLI.
Props
SegmentedControl
Prop
Type
Segment
Prop
Type
Season Wheel
Pick a month, or a span of months, from the year laid out as a ring tinted by season, each month with its own small glyph.
Signature Pad
A paper area you sign with a brush: ink thickens when you slow down, thins when you hurry and bleeds a little where each stroke begins. A Type instead switch lets anyone without a pointer type their name, set in a script hand.