|
1 | 1 | import React, { useState } from 'react';
|
2 | 2 | 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 | + |
3 | 11 | import css from './BasicExample.module.scss';
|
4 | 12 |
|
5 | 13 | export default function BasicExample() {
|
6 | 14 | const [value, onValueChange] = useState(null);
|
| 15 | + const [view, setView] = useState(null); |
| 16 | + const [filter, setFilter] = useState(null); |
7 | 17 |
|
8 | 18 | return (
|
9 | 19 | <FlexCell width="auto" cx={ css.container }>
|
@@ -40,6 +50,22 @@ export default function BasicExample() {
|
40 | 50 | onValueChange={ onValueChange }
|
41 | 51 | isDisabled
|
42 | 52 | />
|
| 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 | + /> |
43 | 69 | </FlexCell>
|
44 | 70 | );
|
45 | 71 | }
|
0 commit comments