Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Commit

Permalink
refactor(Select): Better demo with more items
Browse files Browse the repository at this point in the history
  • Loading branch information
diondiondion committed Sep 22, 2020
1 parent ee831e3 commit 6d07c58
Showing 1 changed file with 41 additions and 6 deletions.
47 changes: 41 additions & 6 deletions src/Select/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,57 @@ There are known issues around this pattern when using VoiceOver with Safari on m
<Playground>
{() => {
const [selectedValue, setSelectedValue] = React.useState(0);
const options = [
'Apple',
'Apricot',
'Banana',
'Blueberry',
'Cherry',
'Fig',
'Feijoa',
'Gooseberry',
'Jackfruit',
'Jujube',
'Kiwi',
'Kumquat',
'Lingonberry',
'Lychee',
'Mandarin',
'Mango',
'Melon',
'Nectarine',
'Orange',
'Papaya',
'Passion Fruit',
'Pear',
'Persimmon',
'Physalis',
'Pineapple',
'Plum',
'Pomegranate',
'Pomelo',
'Raspberry',
'Starfruit',
'Strawberry',
'Watermelon',
'Wumpa',
];
return (
<>
<Text as="label" id="demo-menu-label" display="block" bold>
Select time period
Select a fruit
</Text>
<Select
id="demo-menu"
labelledById="demo-menu-label"
value={selectedValue}
onChange={setSelectedValue}
>
<Option value={0}>Hourly</Option>
<Option value={1}>Daily</Option>
<Option value={2}>Weekly</Option>
<Option value={3}>Monthly</Option>
<Option value={4}>Yearly</Option>
{options.map(item => (
<Option key={item} value={item}>
{item}
</Option>
))}
</Select>
</>
);
Expand Down

0 comments on commit 6d07c58

Please sign in to comment.