```tsx
import React from 'react';
import { NavigationDrawer } from '@salutejs/plasma-web';
export function App() {
const sections = [{
items: [
{
label: 'Главная',
selected: true
},
{
label: 'Выход',
},
]
}];
return (
Основной контент
);
}
```
```tsx
import React from 'react';
import { NavigationDrawer } from '@salutejs/plasma-web';
export function App() {
const sections = [{
items: [
{
label: 'Главная',
selected: true
},
{
label: 'Выход',
},
]
}];
return (
Основной контент
);
}
```
```tsx
import React from 'react';
import { NavigationDrawer } from '@salutejs/plasma-web';
export function App() {
const ContentLeft = (
)
const sections = [
{
label: 'Section 1',
items: [
{
label: 'Item 1',
contentLeft: ContentLeft,
selected: true,
},
{
label: 'Item 2',
contentLeft: ContentLeft,
counter: 1,
},
{
label: 'Item 3',
contentLeft: ContentLeft,
disabled: true,
},
{
label: 'Item 4',
contentLeft: ContentLeft,
hasIndicator: true,
},
{ label: 'Item 5', contentLeft: ContentLeft },
],
},
];
return (
Основной контент
);
}
```
```tsx
import React from 'react';
import { NavigationDrawer } from '@salutejs/plasma-web';
export function App() {
const sections = [{
items: [
{
label: 'Главная',
selected: true
},
{
label: 'Выход',
},
]
}];
return (
Основной контент
);
}
```
```tsx
import React from 'react';
import { NavigationDrawer } from '@salutejs/plasma-web';
export function App() {
const ContentLeft = (
)
const sections = [
{
label: 'Section 1',
items: [
{
label: 'Item 1',
contentLeft: ContentLeft,
selected: true,
},
{
label: 'Item 2',
contentLeft: ContentLeft,
counter: 1,
},
{
label: 'Item 3',
contentLeft: ContentLeft,
disabled: true,
},
{
label: 'Item 4',
contentLeft: ContentLeft,
hasIndicator: true,
},
{ label: 'Item 5', contentLeft: ContentLeft },
],
},
];
return (
Основной контент
);
}
```
```tsx
import React, { useState } from 'react';
import { NavigationDrawer, Button } from '@salutejs/plasma-web';
import { IconBlankOutline, IconSettingsFill, IconHomeAltFill, IconLogout, IconStacksOutline } from '@salutejs/plasma-icons';
export function App() {
const [isOpen, setIsOpen] = useState(true);
return (
,
selected: true,
action: () => console.log('Главная')
},
{
label: 'Настройки',
icon:
,
action: () => console.log('Настройки'),
},
]
},
{
label: 'Документы',
items: [
{
label: 'Обзор документов',
icon:
,
action: () => console.log('Обзор документов'),
},
{
label: 'С индикатором',
icon:
,
action: () => console.log('С индикатором'),
hasIndicator: true
},
]
},
{
items: [
{
label: 'Выход',
icon:
,
action: () => console.log('Выход')
},
]
}
]}
>
Основной контент приложения
);
}
```
```tsx
import React from 'react';
import { NavigationDrawer } from '@salutejs/plasma-web';
export function App() {
const sections = [{
items: [
{
label: 'Главная',
selected: true
},
{
label: 'Выход',
},
]
}];
return (
Основной контент
);
}
```
```tsx
import React from 'react';
import { NavigationDrawer } from '@salutejs/plasma-web';
export function App() {
const ContentLeft = (
)
const sections = [
{
label: 'Section 1',
items: [
{
label: 'Item 1',
contentLeft: ContentLeft,
selected: true,
},
{
label: 'Item 2',
contentLeft: ContentLeft,
counter: 1,
},
{
label: 'Item 3',
contentLeft: ContentLeft,
disabled: true,
},
{
label: 'Item 4',
contentLeft: ContentLeft,
hasIndicator: true,
},
{ label: 'Item 5', contentLeft: ContentLeft },
],
},
];
return (
Основной контент
);
}
```
```tsx
import React, { useState } from 'react';
import { NavigationDrawer, Button } from '@salutejs/plasma-web';
import { IconBlankOutline, IconSettingsFill, IconHomeAltFill, IconLogout, IconStacksOutline } from '@salutejs/plasma-icons';
export function App() {
const [isOpen, setIsOpen] = useState(true);
return (
,
selected: true,
action: () => console.log('Главная')
},
{
label: 'Настройки',
icon:
,
action: () => console.log('Настройки'),
},
]
},
{
label: 'Документы',
items: [
{
label: 'Обзор документов',
icon:
,
action: () => console.log('Обзор документов'),
},
{
label: 'С индикатором',
icon:
,
action: () => console.log('С индикатором'),
hasIndicator: true
},
]
},
{
items: [
{
label: 'Выход',
icon:
,
action: () => console.log('Выход')
},
]
}
]}
>
Основной контент приложения
);
}
```
```tsx
import React, { useState } from 'react';
import { NavigationDrawer, Button } from '@salutejs/plasma-web';
import { IconBlankOutline } from '@salutejs/plasma-icons';
export function App() {
const [isOpen, setIsOpen] = useState(false);
return (
setIsOpen(false)}
sections={[
{
hasDivider: false,
items: [
{
label: 'Пункт меню',
action: () => console.log('Клик'),
icon: ,
}
]
}
]}
>
Основной контент
);
}
```
```tsx
import React from 'react';
import { NavigationDrawer } from '@salutejs/plasma-web';
export function App() {
const sections = [{
items: [
{
label: 'Главная',
selected: true
},
{
label: 'Выход',
},
]
}];
return (
Основной контент
);
}
```
```tsx
import React from 'react';
import { NavigationDrawer } from '@salutejs/plasma-web';
export function App() {
const ContentLeft = (
)
const sections = [
{
label: 'Section 1',
items: [
{
label: 'Item 1',
contentLeft: ContentLeft,
selected: true,
},
{
label: 'Item 2',
contentLeft: ContentLeft,
counter: 1,
},
{
label: 'Item 3',
contentLeft: ContentLeft,
disabled: true,
},
{
label: 'Item 4',
contentLeft: ContentLeft,
hasIndicator: true,
},
{ label: 'Item 5', contentLeft: ContentLeft },
],
},
];
return (
Основной контент
);
}
```
```tsx
import React, { useState } from 'react';
import { NavigationDrawer, Button } from '@salutejs/plasma-web';
import { IconBlankOutline, IconSettingsFill, IconHomeAltFill, IconLogout, IconStacksOutline } from '@salutejs/plasma-icons';
export function App() {
const [isOpen, setIsOpen] = useState(true);
return (
,
selected: true,
action: () => console.log('Главная')
},
{
label: 'Настройки',
icon:
,
action: () => console.log('Настройки'),
},
]
},
{
label: 'Документы',
items: [
{
label: 'Обзор документов',
icon:
,
action: () => console.log('Обзор документов'),
},
{
label: 'С индикатором',
icon:
,
action: () => console.log('С индикатором'),
hasIndicator: true
},
]
},
{
items: [
{
label: 'Выход',
icon:
,
action: () => console.log('Выход')
},
]
}
]}
>
Основной контент приложения
);
}
```
```tsx
import React, { useState } from 'react';
import { NavigationDrawer, Button } from '@salutejs/plasma-web';
import { IconBlankOutline } from '@salutejs/plasma-icons';
export function App() {
const [isOpen, setIsOpen] = useState(false);
return (
setIsOpen(false)}
sections={[
{
hasDivider: false,
items: [
{
label: 'Пункт меню',
action: () => console.log('Клик'),
icon: ,
}
]
}
]}
>
Основной контент
);
}
```
```tsx
import React, { useState } from 'react';
import { NavigationDrawer, Button } from '@salutejs/plasma-web';
import { IconBlankOutline } from '@salutejs/plasma-icons';
export function App() {
const [isOpen, setIsOpen] = useState(false);
return (
console.log('Клик'),
icon: ,
}
]
}
]}
>
Основной контент
);
}
```
```tsx
import React from 'react';
import { NavigationDrawer } from '@salutejs/plasma-web';
export function App() {
const sections = [{
items: [
{
label: 'Главная',
selected: true
},
{
label: 'Выход',
},
]
}];
return (
Основной контент
);
}
```
```tsx
import React from 'react';
import { NavigationDrawer } from '@salutejs/plasma-web';
export function App() {
const ContentLeft = (
)
const sections = [
{
label: 'Section 1',
items: [
{
label: 'Item 1',
contentLeft: ContentLeft,
selected: true,
},
{
label: 'Item 2',
contentLeft: ContentLeft,
counter: 1,
},
{
label: 'Item 3',
contentLeft: ContentLeft,
disabled: true,
},
{
label: 'Item 4',
contentLeft: ContentLeft,
hasIndicator: true,
},
{ label: 'Item 5', contentLeft: ContentLeft },
],
},
];
return (
Основной контент
);
}
```
```tsx
import React, { useState } from 'react';
import { NavigationDrawer, Button } from '@salutejs/plasma-web';
import { IconBlankOutline, IconSettingsFill, IconHomeAltFill, IconLogout, IconStacksOutline } from '@salutejs/plasma-icons';
export function App() {
const [isOpen, setIsOpen] = useState(true);
return (
,
selected: true,
action: () => console.log('Главная')
},
{
label: 'Настройки',
icon:
,
action: () => console.log('Настройки'),
},
]
},
{
label: 'Документы',
items: [
{
label: 'Обзор документов',
icon:
,
action: () => console.log('Обзор документов'),
},
{
label: 'С индикатором',
icon:
,
action: () => console.log('С индикатором'),
hasIndicator: true
},
]
},
{
items: [
{
label: 'Выход',
icon:
,
action: () => console.log('Выход')
},
]
}
]}
>
Основной контент приложения
);
}
```
```tsx
import React, { useState } from 'react';
import { NavigationDrawer, Button } from '@salutejs/plasma-web';
import { IconBlankOutline } from '@salutejs/plasma-icons';
export function App() {
const [isOpen, setIsOpen] = useState(false);
return (
setIsOpen(false)}
sections={[
{
hasDivider: false,
items: [
{
label: 'Пункт меню',
action: () => console.log('Клик'),
icon: ,
}
]
}
]}
>
Основной контент
);
}
```
```tsx
import React, { useState } from 'react';
import { NavigationDrawer, Button } from '@salutejs/plasma-web';
import { IconBlankOutline } from '@salutejs/plasma-icons';
export function App() {
const [isOpen, setIsOpen] = useState(false);
return (
console.log('Клик'),
icon: ,
}
]
}
]}
>
Основной контент
);
}
```
```tsx
import React, { useState, useRef, useEffect } from 'react';
import { NavigationDrawer } from '@salutejs/plasma-web';
import { IconBlankOutline } from '@salutejs/plasma-icons';
export function App() {
const [isOpen, setIsOpen] = useState(false);
const ref = useRef(null);
useEffect(() => {
if (ref.current) {
const sidebar = ref.current.childNodes[0] as HTMLDivElement;
sidebar.onmouseenter = () => {
setIsOpen(true);
};
sidebar.onmouseleave = () => {
setIsOpen(false);
};
}
}, [ref]);
return (
console.log('Клик'),
icon: ,
}
]
}
]}
>
);
}
```