Skip to main content

Select

import { Select } from '@tulsa/core';

<Select required>
<Select.Option value={"Hello"}>Hello</Select.Option>
<Select.Option value={"World"}>World</Select.Option>
</Select>

Props

NameTypeDescriptionDefault
placeholderstringSets an option that will be displayed automatically
requiredbooleanSets whether or not a value is required to be selected for the element

Native props are forwarded to the root component.

Examples

Placeholder

<Select placeholder='Placeholder'>
<Select.Option value={"Hello"}>Hello</Select.Option>
<Select.Option value={"World"}>World</Select.Option>
</Select>

Disabled

<Select disabled>
<Select.Option value={"Hello"}>Hello</Select.Option>
<Select.Option value={"World"}>World</Select.Option>
</Select>

Option Groups

<Select placeholder='Placeholder'>
<Select.OptGroup label="Group 1">
<Select.Option value={"Hello"}>Hello</Select.Option>
<Select.Option value={"World"}>World</Select.Option>
</Select.OptGroup>
<Select.OptGroup label="Group 2">
<Select.Option value={"Hello"}>Hello</Select.Option>
<Select.Option value={"World"}>World</Select.Option>
</Select.OptGroup>
</Select>

Select.Option

Props

NameTypeDescriptionDefault
value*stringValue of the option

Native props are forwarded to the root component.

Select.OptGroup

Props

HTMLProps<"optgroup">