Leave Yamada UI a star

Star
Yamada UIYamada UIv1.6.4

NativeSelect

NativeSelect is a component used for allowing users to select one option from a list. It displays a native dropdown list provided by the browser (user agent).

Source@yamada-ui/native-select

If you are not using FormControl, set aria-label or aria-labelledby to NativeSelect.

<NativeSelect placeholder="キャラクターを選択" aria-label="キャラクター">
<NativeOption value="孫悟空">孫悟空</NativeOption>
<NativeOption value="ベジータ">ベジータ</NativeOption>
<NativeOption value="フリーザ">フリーザ</NativeOption>
</NativeSelect>
Copied!
<VStack gap="sm">
<Heading as="h3" id="label">
キャラクター
</Heading>
<NativeSelect placeholder="キャラクターを選択" aria-labelledby="label">
<NativeOption value="孫悟空">孫悟空</NativeOption>
<NativeOption value="ベジータ">ベジータ</NativeOption>
<NativeOption value="フリーザ">フリーザ</NativeOption>
</NativeSelect>
</VStack>
Copied!

ARIA Roles and Attributes

ComponentRoles and AttributesUsage
NativeSelectaria-readonlySet to "true" when isReadOnly is set.
aria-disabledSet to "true" when isDisabled is set.
aria-invalidSet to "true" when isInvalid is set.
aria-requiredSet to "true" when isRequired is set.

Edit this page on GitHub

PreviousMultiSelectNextAutocomplete