ValyroUI English version

App Shell

Каркас приложения. Бесплатно, MIT · Навигация и каркас › Каркас

Установка

npx valyro-cli@latest add app-shell
npx shadcn@latest add https://valyro.xyz/r/app-shell.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { AppShell } from 'valyro-ui';

Пропсы

PropTypeDefault
sidebarSlotNavigation column, e.g. a <Sidebar>. A function receives the shell state (sidebarCollapsed, mobile…).
headerSlotTop bar above the main area; stays put while the main area scrolls.
asideSlotOptional panel after the main area (details, inspector, settings).
childrenSlotMain content; it scrolls on its own. Or the compound form: AppShell.Header, .Sidebar, .Main, .Aside and .Footer, each holding what the prop of that name holds.
footerSlotBar under the main area that stays put while it scrolls, e.g. a chat composer or bulk actions.
sidebarCollapsedbooleanIcon-rail sidebar. Pair with onSidebarCollapsedChange (and storage) to remember it.
defaultSidebarCollapsedbooleanfalseInitial sidebarCollapsed when uncontrolled.
onSidebarCollapsedChange(collapsed: boolean) => voidCalled with the new sidebarCollapsed when it changes.
asideOpenbooleanWhether the aside shows inline on wide shells.
defaultAsideOpenbooleantrueInitial asideOpen when uncontrolled.
onAsideOpenChange(open: boolean) => voidCalled with the new asideOpen when it changes.
mobileBreakpointnumber768Below this shell width (px) the sidebar becomes an off-canvas drawer. Measured on the shell, not the window.
asideBreakpointnumber1200Below this shell width (px) the aside floats over the main area instead of taking a column.
mainIdstringId of the main element, the skip link's target.
labelsPartial<AppShellLabels>Overrides for the built-in English text; keys left out keep their defaults.

Составные части

AppShell.Header (AppShellHeader), AppShell.Sidebar (AppShellSidebar), AppShell.Main (AppShellMain), AppShell.Aside (AppShellAside), AppShell.Footer (AppShellFooter)

Похожие компоненты

  • Navbar — Верхняя навигация
  • Sidebar — Боковая панель
  • Resizable Panels — Панели с изменяемым размером
  • Breadcrumbs — Хлебные крошки
  • Tabs — Вкладки
  • Segmented Control — Переключатель режимов
  • Pagination — Постраничная навигация
  • Stepper — Пошаговые процессы
  • Dropdown Menu — Выпадающее меню
  • Context Menu — Контекстное меню
  • Command Palette — Меню команд в стиле ⌘K
  • Keyboard Map Overlay — Карта горячих клавиш экрана: поиск, клавиатура и режим тренировки

Назад: Progress Bar · Далее: Navbar · Весь раздел «Навигация и каркас»