Fidely UI v1 beta is now available!. šŸš€

Select

Displays a list of options for the user to pick from.

Usage

import { Select } from '@fidely-ui/react'
<Select.Root
  collection={collection}
  positioning={{ sameWidth: true }}
  maxW={'350px'}
>
  <Select.Label>Framework</Select.Label>
  <Select.Control>
    <Select.Trigger>
      <Select.ValueText placeholder="Select a Framework" />
      <Select.Indicator>
        <BiChevronDown />
      </Select.Indicator>
    </Select.Trigger>
    <Select.ClearTrigger>Clear</Select.ClearTrigger>
  </Select.Control>
  <Portal>
    <Select.Positioner>
      <Select.Content>
        <Select.ItemGroup>
          <Select.ItemGroupLabel>Frameworks</Select.ItemGroupLabel>
          <Select.Item key={item} item={item}>
            <Select.ItemText>Hello</Select.ItemText>
            <Select.ItemIndicator>āœ“</Select.ItemIndicator>
          </Select.Item>
        </Select.ItemGroup>
      </Select.Content>
    </Select.Positioner>
  </Portal>
  <Select.HiddenSelect />
</Select.Root>

Examples

Variants

Use the variant prop to change the appearance of the Select component.

Sizes

Use the size prop to adjust the size of the Select component.

Option Group

Use the Select.ItemGroup component to group related select options.

Controlled

Use the value and onValueChange props to control the select component.

Disabled

Use the value and onValueChange props to control the select component.

Multiple

Use the multiple prop to allow multiple selections.

Positioning

Use the positioning prop to control the underlying floating-ui options of the select component.

ClearTrigger

Render the Select.ClearTrigger component to show a clear text or button (you can customize its design as needed).

Clicking the clear button will clear the selected value.

Props

Root

On this page