Volt UI
ComponentsField

Field Select

A select field component for the Field component.

Usage

The FieldSelect component provides a select field component for the Field component.

import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
  SelectGroup,
  SelectLabel,
} from "@epilot/volt-ui"

<Field variant="highlight">
  <FieldLabel>Theme</FieldLabel>
  <Select>
    <SelectTrigger>
      <SelectValue placeholder="Select a theme" />
    </SelectTrigger>
    <SelectContent>
      <SelectGroup>
        <SelectLabel>Themes</SelectLabel>
        <SelectItem value="system">System</SelectItem>
        <SelectItem value="light">Light</SelectItem>
        <SelectItem value="dark">Dark</SelectItem>
      </SelectGroup>
    </SelectContent>
  </Select>
</Field>

API Reference

Select

Root component for the select. Accepts all standard Radix UI Select Root props.

PropTypeDefaultDescription
valuestring-The controlled value of the select.
defaultValuestring-The value of the select when initially rendered.
onValueChange(value: string) => void-Event handler called when the value changes.
openboolean-The controlled open state of the select.
defaultOpenboolean-The open state of the select when initially rendered.
onOpenChange(open: boolean) => void-Event handler called when the open state changes.
disabledbooleanfalseWhen set to true, the select is disabled.
namestring-The name of the select. Submitted with its owning form as part of a name/value pair.
requiredbooleanfalseWhen set to true, the select is required.
containerReact.ReactNode-The container to render the select content in.

SelectTrigger

The button that toggles the select. Accepts all standard Radix UI Select Trigger props.

PropTypeDefaultDescription
classNamestring-Additional CSS classes.
disabledbooleanfalseWhen set to true, the trigger is disabled.
asChildbooleanfalseChange the component to the HTML tag or custom component.

SelectValue

Displays the selected value or placeholder. Accepts all standard Radix UI Select Value props.

PropTypeDefaultDescription
placeholderstring-The placeholder text shown when no value is selected.

SelectContent

The content of the select dropdown. Accepts all standard Radix UI Select Content props.

PropTypeDefaultDescription
classNamestring-Additional CSS classes.
position"popper" | "item-aligned""popper"The positioning strategy to use.
align"start" | "center" | "end""center"The alignment of the content relative to the trigger.
side"top" | "right" | "bottom" | "left""bottom"The side of the trigger to render against.
sideOffsetnumber4The distance in pixels from the trigger.

SelectItem

An item in the select dropdown. Accepts all standard Radix UI Select Item props.

PropTypeDefaultDescription
valuestring-The value of the item (required).
classNamestring-Additional CSS classes.
disabledbooleanfalseWhen set to true, the item is disabled.

SelectLabel

A label for grouping items in the select dropdown. Accepts all standard Radix UI Select Label props.

PropTypeDefaultDescription
classNamestring-Additional CSS classes.

SelectGroup

Groups items together in the select dropdown. Accepts all standard Radix UI Select Group props.

PropTypeDefaultDescription
classNamestring-Additional CSS classes.

SelectSeparator

A visual separator between items in the select dropdown. Accepts all standard Radix UI Select Separator props.

PropTypeDefaultDescription
classNamestring-Additional CSS classes.