mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-07 14:08:47 +00:00
35 lines
1018 B
TypeScript
35 lines
1018 B
TypeScript
import { Field, FieldDescription, FieldLabel } from "@/examples/radix/ui/field"
|
|
import {
|
|
Select,
|
|
SelectContent,
|
|
SelectGroup,
|
|
SelectItem,
|
|
SelectTrigger,
|
|
SelectValue,
|
|
} from "@/examples/radix/ui/select"
|
|
|
|
export function SelectWithField() {
|
|
return (
|
|
<Field>
|
|
<FieldLabel htmlFor="select-fruit">Favorite Fruit</FieldLabel>
|
|
<Select>
|
|
<SelectTrigger id="select-fruit">
|
|
<SelectValue placeholder="Select a fruit" />
|
|
</SelectTrigger>
|
|
<SelectContent>
|
|
<SelectGroup>
|
|
<SelectItem value="apple">Apple</SelectItem>
|
|
<SelectItem value="banana">Banana</SelectItem>
|
|
<SelectItem value="blueberry">Blueberry</SelectItem>
|
|
<SelectItem value="grapes">Grapes</SelectItem>
|
|
<SelectItem value="pineapple">Pineapple</SelectItem>
|
|
</SelectGroup>
|
|
</SelectContent>
|
|
</Select>
|
|
<FieldDescription>
|
|
Choose your favorite fruit from the list.
|
|
</FieldDescription>
|
|
</Field>
|
|
)
|
|
}
|