ControlsNew
Glass Select
A select field whose options open on a raised glass panel.
Preview
Demos ready. Update 0.
The preview runs the React version. On iOS 26 and later, the React Native version uses the system’s own glass. See it on a phone.
Installation
For React 19+ apps with Tailwind CSS 4.
npx shadcn@4.14.1 add @glassyui/glass-selectAdds 12 files to components/glassyui and installs @radix-ui/react-select and clsx.
Usage
import {
GlassSelect,
GlassSelectContent,
GlassSelectItem,
GlassSelectTrigger,
GlassSelectValue,
} from "@/components/glassyui/glass-select";
export function FrameworkDemo() {
return (
<GlassSelect>
<GlassSelectTrigger aria-label="Framework">
<GlassSelectValue placeholder="Choose a framework" />
</GlassSelectTrigger>
<GlassSelectContent>
<GlassSelectItem value="next">Next.js</GlassSelectItem>
<GlassSelectItem value="remix">Remix</GlassSelectItem>
</GlassSelectContent>
</GlassSelect>
);
}import { useState } from 'react';
import {
GlassSelect,
GlassSelectContent,
GlassSelectItem,
GlassSelectTrigger,
GlassSelectValue,
} from '@/components/glassyui/glass-select';
export default function SelectExample() {
const [city, setCity] = useState('');
return (
<GlassSelect onValueChange={setCity} value={city}>
<GlassSelectTrigger accessibilityLabel="City">
<GlassSelectValue placeholder="Choose a city" />
</GlassSelectTrigger>
<GlassSelectContent>
<GlassSelectItem value="lisbon">Lisbon</GlassSelectItem>
<GlassSelectItem value="oslo">Oslo</GlassSelectItem>
<GlassSelectItem value="tokyo">Tokyo</GlassSelectItem>
</GlassSelectContent>
</GlassSelect>
);
}
Examples
<GlassSelectContent>
<GlassSelectGroup>
<GlassSelectLabel>React</GlassSelectLabel>
<GlassSelectItem value="next">Next.js</GlassSelectItem>
</GlassSelectGroup>
<GlassSelectSeparator />
<GlassSelectGroup>
<GlassSelectLabel>Other</GlassSelectLabel>
<GlassSelectItem value="astro">Astro</GlassSelectItem>
</GlassSelectGroup>
</GlassSelectContent>API reference
GlassSelect
| Prop | Type | Default | Description |
|---|---|---|---|
value / defaultValue | string | None | Controlled or uncontrolled selected value. |
onValueChange | (value: string) => void | None | Called with the value of the chosen item. |
open / onOpenChange | boolean / (open: boolean) => void | None | Controls whether the list is open. |
name | string | None | Submits the value with a native form, and a form reset restores the initial value. |
disabled | boolean | false | Stops the select from opening. |
Also accepts Radix Select.Root props.
GlassSelectTrigger
The closed field, with a chevron.
Also accepts Radix Select.Trigger props.
GlassSelectValue
Shows the chosen item's text inside the trigger.
| Prop | Type | Default | Description |
|---|---|---|---|
placeholder | ReactNode | None | Shown while no value is chosen. |
Also accepts Radix Select.Value props.
GlassSelectContent
The open list on a glass panel, at least as wide as the trigger.
| Prop | Type | Default | Description |
|---|---|---|---|
position | 'popper' | 'item-aligned' | 'popper' | popper places the list below the trigger; item-aligned lays it over the trigger at the chosen item. |
sideOffset | number | 8 | Gap between the trigger and the list, in pixels. |
className | string | None | Applies to the glass panel. |
Also accepts Radix Select.Content props.
GlassSelectItem
One option, with a check mark when chosen.
| Prop | Type | Default | Description |
|---|---|---|---|
valueRequired | string | None | The option's value. Cannot be an empty string; an empty value shows the placeholder. |
disabled | boolean | false | Makes the option unselectable. |
Also accepts Radix Select.Item props.
GlassSelectGroup / GlassSelectLabel / GlassSelectSeparator
Group options under a heading and divide groups with a line.
Also accepts Radix Select.Group, Select.Label and Select.Separator props.
- Types
GlassSelectTriggerPropsGlassSelectContentPropsGlassSelectItemProps- Accessibility
- Name the trigger with aria-label or a label element; it shows only the chosen value.
The React Native props and exports are in the component’s source.