Holiday sale: 40% off Pro with code · limited offer · ends Dec 31
See ProA segmented control whose selection is a sliding drop of refractive glass: it travels on a spring with overshoot, stretches along its direction of travel, and magnifies the label underneath it like a real lens. Grab the lens to scrub between segments with momentum and a rubber band past both ends, or tap any segment; arrow keys, Home and End work as a radio group. Text, icon and mixed segments, light and dark glass, and a frosted fallback where SVG backdrop filters are missing.
Included in Pro and aboveCompare plans
Live preview. Move the mouse, scroll and click inside the frame.
The copied code, markdown and prompt include the values you set here.
import { GlassSegmentedDemo } from "@/components/hyperblur-pro/glass-segmented-control"
<GlassSegmentedDemo />
<GlassSegmentedControl
aria-label="Range"
options={[{ value: "day", label: "Day" }, { value: "week", label: "Week" }, { value: "month", label: "Month" }]}
defaultValue="week"
onChange={(v) => console.log(v)}
/>| Prop | Type | Default | Description |
|---|---|---|---|
| options | { value: string; label?: string; icon?: ReactNode }[] | required | GlassSegmentedControl: the segments. Icon only segments use value as their accessible name. |
| value / defaultValue | string | first option | GlassSegmentedControl: controlled or uncontrolled selection. |
| onChange | (value: string) => void | undefined | GlassSegmentedControl: called when the lens settles on a new segment. |
| appearance | "light" | "dark" | "auto" | "light" | Glass tint and label color. |
| accent | string | "#0a84ff" | Color of the selected label and the focus ring. |
| size | "sm" | "md" | "lg" | "md" | GlassSegmentedControl: 36, 46 or 58 px tall. |
| magnify | number | 1.14 | How much the lens enlarges the label under it. |
| refraction | number | 1 | Strength of the edge lens on the track and the selection. |
| image | string | "https://images.unsplash.com/photo-1501785888041-af3ef285b470" | GlassSegmentedDemo: backdrop photo. |
| title / subtitle | string | "Pick a lens." | GlassSegmentedDemo: heading and paragraph. |
Source code is included in Pro and above