Skip to content

Commit

Permalink
docs: updated multiselect docs with select all feature details and us…
Browse files Browse the repository at this point in the history
…age (#17758)

* docs: updated multiselect docs with select all feature usage

* Update packages/react/src/components/MultiSelect/MultiSelect.mdx

Co-authored-by: kennylam <909118+kennylam@users.noreply.github.com>

* Update packages/react/src/components/MultiSelect/MultiSelect.mdx

Co-authored-by: Alison Joseph <alison.joseph@us.ibm.com>

* Update packages/react/src/components/MultiSelect/MultiSelect.mdx

Co-authored-by: Alison Joseph <alison.joseph@us.ibm.com>

* docs: added select all to navigation

---------

Co-authored-by: kennylam <909118+kennylam@users.noreply.github.com>
Co-authored-by: Alison Joseph <alison.joseph@us.ibm.com>
  • Loading branch information
3 people authored Oct 23, 2024
1 parent 98e15cc commit dbc173d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/react/src/components/MultiSelect/MultiSelect.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import * as MultiSelect from './MultiSelect.stories';

- [Overview](#overview)
- [With initial selected items](#with-initial-selected-items)
- [Select all](#select-all)
- [Filtering](#filtering)
- [With layer](#with-layer)
- [Component API](#component-api)
Expand All @@ -42,6 +43,29 @@ By passing items into the `initialSelectedItems` prop, they can be pre-selected.

<Canvas of={MultiSelect.WithInitialSelectedItems} />

### Select all

The MultiSelect component includes a "Select All" feature, allowing users to
easily select or deselect all options with a single action.

To implement the "Select All" feature in your MultiSelect component, add a new
option to your options array with these properties:

- `id`: A unique identifier (e.g., 'select-all')
- `text`: The label for the option
- `isSelectAll`: Set to `true`

```
const options = [
{
id: 'select-all',
text: 'All roles',
isSelectAll: true,
},
// ... other options
];
```

### Filtering

The `FilterableMultiSelect` component allows for filtering the list of
Expand Down

0 comments on commit dbc173d

Please sign in to comment.