- Home
- Primitives
- Select
- Examples
Select
Basic select example demonstrating core behavior.
Examples
import * as Select from "@solidiom/select"
;<Select.Root>Select content</Select.Root>View source
export function SelectExample(props: SelectExampleProps) {
const copy = () => COPY[props.locale]
return (
<div ref={(el) => el.setAttribute("data-hydrated", "true")} class="select-example">
<Select.Root>
<Select.Trigger aria-label={copy().label}>
<Select.Value placeholder={copy().label} />
</Select.Trigger>
<Select.Content>
{copy().items.map((item) => (
<Select.Item value={item.toLowerCase()}>{item}</Select.Item>
))}
</Select.Content>
</Select.Root>
</div>
)
}