SideMenuItem
Ссылка или действие SideMenu с произвольной глубиной вложенности. Наличие children определяет collapsible; отступ вычисляется автоматически. Start и стрелка сменяют друг друга в одной ячейке. End и notification — независимые слоты рядом с основным действием, без вложенных кнопок.
Использование
Состояния
Доступность
href создаёт настоящую ссылку, без href создаётся button. Ref и native attrs относятся к основному действию. Для раскрытия доступны отдельная кнопка и стрелки клавиатуры с учётом RTL. Focus основного действия сохраняет enabled; при переходе Tab непосредственно к дополнительному действию оно становится видимым.
API
| Проп | Тип | По умолчанию | Описание |
|---|---|---|---|
label* | ReactNode | — | Non-interactive primary label. Long text truncates with ellipsis. |
description | ReactNode | — | Optional description; wraps within the remaining width. |
start | ReactNode | — | Leading icon. A collapsible item swaps it for its disclosure on hover/active. |
end | ReactNode | — | Independent actions; shown on hover/active or while actionsVisible is true. |
notification | ReactNode | — | Persistent notification content; numeric zero is preserved. |
children | ReactNode | — | Nested items; their presence determines collapsible and indentation. |
selected | boolean | | Current navigation destination. |
disabled | boolean | | Disable the primary action and all start/end actions. |
expanded | boolean | — | Controlled disclosure state. |
defaultExpanded | boolean | | Initial uncontrolled disclosure state. |
onExpandedChange | (expanded: boolean) => void | — | Receives disclosure changes. |
actionsVisible | boolean | | Keep secondary actions visible while an associated popup is open. |
onClick | MouseEventHandler<HTMLAnchorElement | HTMLButtonElement> | — | Primary activation only; slot actions never invoke this handler. |
onKeyDown | KeyboardEventHandler<HTMLAnchorElement | HTMLButtonElement> | — | Native primary key handler; preventDefault cancels built-in navigation. |
onAuxClick | MouseEventHandler<HTMLAnchorElement | HTMLButtonElement> | — | — |
Last updated on