Skip to content

Commit 861e44c

Browse files
Merge pull request #2642 from epam/2616-multiswitch-add-example-or-property-with-icon-+-caption-and-icon-only
[MultiSwitch]: new examples
2 parents 2e10f6a + 4647b36 commit 861e44c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

app/src/docs/_examples/multiSwitch/Basic.example.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
import React, { useState } from 'react';
22
import { FlexCell, MultiSwitch, Text } from '@epam/uui';
3+
4+
import { ReactComponent as TableIcon } from '@epam/assets/icons/content-view_table-outline.svg';
5+
import { ReactComponent as GridIcon } from '@epam/assets/icons/content-view_grid-fill.svg';
6+
import { ReactComponent as DetailsIcon } from '@epam/assets/icons/content-view_detailes-fill.svg';
7+
import { ReactComponent as StarIcon } from '@epam/assets/icons/communication-star-fill.svg';
8+
import { ReactComponent as ClockIcon } from '@epam/assets/icons/action-schedule-outline.svg';
9+
import { ReactComponent as ChatIcon } from '@epam/assets/icons/communication-chat-outline.svg';
10+
311
import css from './BasicExample.module.scss';
412

513
export default function BasicExample() {
614
const [value, onValueChange] = useState(null);
15+
const [view, setView] = useState(null);
16+
const [filter, setFilter] = useState(null);
717

818
return (
919
<FlexCell width="auto" cx={ css.container }>
@@ -40,6 +50,22 @@ export default function BasicExample() {
4050
onValueChange={ onValueChange }
4151
isDisabled
4252
/>
53+
<Text>Icon only</Text>
54+
<MultiSwitch
55+
items={ [
56+
{ id: 1, icon: TableIcon }, { id: 2, icon: GridIcon }, { id: 3, icon: DetailsIcon },
57+
] }
58+
value={ view }
59+
onValueChange={ setView }
60+
/>
61+
<Text>Icon + Label</Text>
62+
<MultiSwitch
63+
items={ [
64+
{ id: 1, icon: StarIcon, caption: 'Starred' }, { id: 2, icon: ClockIcon, caption: 'Latest' }, { id: 3, icon: ChatIcon, caption: 'All chats' },
65+
] }
66+
value={ filter }
67+
onValueChange={ setFilter }
68+
/>
4369
</FlexCell>
4470
);
4571
}

0 commit comments

Comments
 (0)