ValyroUI Русская версия

App Shell

Application frame. Free, MIT · Navigation and layout › Structure

Installation

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';

Props

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.

Compound parts

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

Related components

Previous: Progress Bar · Next: Navbar · All Navigation and layout