Select

Select fields are used to create a drop-down list of options for the user to choose from.

The Select field is used to create a drop-down list of options for the user to choose from. This component is built on top of the Radix UI library and styled using Tailwind CSS.

This component comes from the Shadcn UI Library - with minimal changes to the original component. I recommended to check out the original documentation for more information.

import { Select, SelectTrigger, SelectValue, SelectContent, SelectLabel, SelectGroup, SelectItem } from '~/core/ui/Select'; <Select> <SelectTrigger> <SelectValue placeholder={'Pick a fruit...'} /> </SelectTrigger> <SelectContent> <SelectGroup> <SelectLabel>Fruits</SelectLabel> <SelectItem value={'Apple'}>Apple</SelectItem> <SelectItem value={'Banana'}>Banana</SelectItem> <SelectItem value={'Peach'}>Peach</SelectItem> </SelectGroup> </SelectContent> </Select>

API

The complete API documentation for the Select component is available on the Shadcn UI documentation.


Subscribe to our Newsletter
Get the latest updates about React, Remix, Next.js, Firebase, Supabase and Tailwind CSS