forked from adevinta/spark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
242 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { Dropdown } from '@spark-ui/dropdown' | ||
import { BookmarkFill } from '@spark-ui/icons/dist/icons/BookmarkFill' | ||
import React from 'react' | ||
|
||
export const A11yDropdown = () => ( | ||
<section> | ||
<div> | ||
<Dropdown defaultOpen> | ||
<Dropdown.Trigger aria-label="Book"> | ||
<Dropdown.LeadingIcon> | ||
<BookmarkFill /> | ||
</Dropdown.LeadingIcon> | ||
<Dropdown.Value placeholder="Pick a book" /> | ||
</Dropdown.Trigger> | ||
|
||
<Dropdown.Popover> | ||
<Dropdown.Items> | ||
<Dropdown.Item value="book-1">To Kill a Mockingbird</Dropdown.Item> | ||
<Dropdown.Item value="book-2">War and Peace</Dropdown.Item> | ||
<Dropdown.Item value="book-3">The Idiot</Dropdown.Item> | ||
<Dropdown.Item value="book-4">A Picture of Dorian Gray</Dropdown.Item> | ||
<Dropdown.Item value="book-5">1984</Dropdown.Item> | ||
<Dropdown.Item value="book-6">Pride and Prejudice</Dropdown.Item> | ||
</Dropdown.Items> | ||
</Dropdown.Popover> | ||
</Dropdown> | ||
</div> | ||
|
||
<div> | ||
<Dropdown defaultOpen multiple defaultValue={['book-1', 'book-2']}> | ||
<Dropdown.Trigger aria-label="Book"> | ||
<Dropdown.Value placeholder="Pick a book" /> | ||
</Dropdown.Trigger> | ||
|
||
<Dropdown.Popover> | ||
<Dropdown.Items> | ||
<Dropdown.Item value="book-1">To Kill a Mockingbird</Dropdown.Item> | ||
<Dropdown.Item value="book-2">War and Peace</Dropdown.Item> | ||
<Dropdown.Item value="book-3">The Idiot</Dropdown.Item> | ||
<Dropdown.Item value="book-4">A Picture of Dorian Gray</Dropdown.Item> | ||
<Dropdown.Item value="book-5">1984</Dropdown.Item> | ||
<Dropdown.Item value="book-6">Pride and Prejudice</Dropdown.Item> | ||
</Dropdown.Items> | ||
</Dropdown.Popover> | ||
</Dropdown> | ||
</div> | ||
</section> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters