Browse docsSelect

ControlsNew

Glass Select

A select field whose options open on a raised glass panel.

Preview

Demos ready. Update 0.

Installation

For React 19+ apps with Tailwind CSS 4.

npx shadcn@4.14.1 add @glassyui/glass-select

Adds 12 files to components/glassyui and installs @radix-ui/react-select and clsx.

Usage

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>
  );
}

Examples

Groups and separators

<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

PropTypeDefaultDescription
value / defaultValuestringNoneControlled or uncontrolled selected value.
onValueChange(value: string) => voidNoneCalled with the value of the chosen item.
open / onOpenChangeboolean / (open: boolean) => voidNoneControls whether the list is open.
namestringNoneSubmits the value with a native form, and a form reset restores the initial value.
disabledbooleanfalseStops 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.

PropTypeDefaultDescription
placeholderReactNodeNoneShown 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.

PropTypeDefaultDescription
position'popper' | 'item-aligned''popper'popper places the list below the trigger; item-aligned lays it over the trigger at the chosen item.
sideOffsetnumber8Gap between the trigger and the list, in pixels.
classNamestringNoneApplies to the glass panel.

Also accepts Radix Select.Content props.

GlassSelectItem

One option, with a check mark when chosen.

PropTypeDefaultDescription
valueRequiredstringNoneThe option's value. Cannot be an empty string; an empty value shows the placeholder.
disabledbooleanfalseMakes 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.