Select
Displays a list of options for the user to pick from—triggered by a button.
import { Label } from "@ngrok/mantle/label";
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from "@ngrok/mantle/select";
Fruits
Fruits
Apple
Banana
Blueberry
Grapes
Pineapple
Vegetables
Carrot
Cucumber
Lettuce
Tomato
Zucchini
Ex sit voluptate incididunt pariatur velit consequat reprehenderit.
Examples
Custom selected value
By default the selected item's text will be rendered when selected. Sometimes you may need to render something different. You can control the select and pass children
instead.
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@ngrok/mantle/select";
{value === "apple" ? <>🍎 Apple! : <>🍑 Peach!}
Apple
Peach
API Reference
The Select
components are built on top of Radix Select.
Select
All props from Radix Select.Root, plus:
SelectTrigger
All props from Radix Select.Trigger, plus:
SelectValue
Radix Select.Value props.
SelectContent
All props from Radix Select.Content, plus:
SelectGroup
Radix Select.Group props.
SelectSeparator
Used to visually separate items in the select. Composed from Mantle Separator.
SelectItem
Radix Select.Item props.
SelectLabel
Radix Select.Label props.
SelectScrollUpButton
Radix Select.ScrollUpButton props.
SelectScrollDownButton
Radix Select.ScrollDownButton props.