Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add example to allow multiple selection on the InternalDropdown… #1656

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/components/InternalDropdown/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,31 @@ function InternalDropdownWithSearch() {

<InternalDropdownWithSearch />
```

##### With multiple selection:

```js
import React, { useState } from 'react';
import { PicklistOption } from 'react-rainbow-components';

function InternalDropdownWithMultipleSelection() {
const [value, setValue] = useState();
return (
<div className="rainbow-m-around_xx-large">
<InternalDropdown value={value} onChange={setValue} enableSearch multiple='true'>
<PicklistOption name="option-1" label="All Buildings" icon={<DashboardIcon />} />
<PicklistOption name="option-2" label="New Building" icon={<AddFilledIcon />} />
<PicklistOption name="header" label="Your Buildings" variant="header" />
<PicklistOption name="option-3" label="Experimental" icon={<BuildingIcon />} />
<PicklistOption name="option-4" label="Bennet Towers" icon={<BuildingIcon />} />
<PicklistOption name="option-5" label="Empire State" icon={<BuildingIcon />} />
<PicklistOption name="option-6" label="Central Park" icon={<BuildingIcon />} />
<PicklistOption name="option-7" label="Chrysler" icon={<BuildingIcon />} />
<PicklistOption name="option-8" label="Plaza" icon={<BuildingIcon />} />
</InternalDropdown>
</div>
);
}

<InternalDropdownWithMultipleSelection />
```