Layout
AppNavigation
One navigation model: a sidebar on desktop, a drawer on a phone.
import { AppNavigation, NavigationDrawer, NavigationGroup, NavigationHeader, NavigationItem, NavigationTrigger, NavigationToggle } from 'faifo-design'AppNavigation renders the same groups and items as a persistent sidebar on wide screens and as an
accessible drawer on narrow ones. The parts (NavigationHeader, NavigationGroup,
NavigationItem, NavigationTrigger, NavigationToggle, NavigationDrawer) are exported for
shells that compose their own.
#When to use
- Pass one model for every breakpoint. Do not maintain a second menu for mobile.
- The active item is a fact of the URL; mark it on the server.
- Counts beside items are data the host provides, already filtered by what the reader may see.
#Examples
Each example is a specimen of the package catalogue, rendered on the server exactly as shown in its code.
#Responsive application navigation
One navigation model becomes a persistent desktop sidebar and an accessible mobile drawer.
Operations overview
Open orders
148
12 need attention
Ready to invoice
91
Updated just now
Show codeHide code
#Navigation in a sidebar island slot
A single wrapper fills the sidebar; the navigation owns its internal scrolling.
Invoices
Show codeHide code
#Contract
#Sidebar island slot height
AppShell gives its sidebar's only child the available block size, including a disposable island wrapper. Navigation keeps its viewport geometry and internal scrolling; consumers do not patch sidebar descendants. Producer CSS check/mutation and Account browser geometry cover this contract. Account's breadcrumb-free canvas is an explicit user choice and still exposes a separate list-return link.
Record runtime exposes draftScope (record / dialog) to namespace input IDs by owning layer. Route dialog metadata is present on both layers and must not determine control IDs. A refused submit focuses the first invalid control after rendering the retained draft.
Button and LinkButton accept optional truncateLabel for single-line record
values inside constrained layouts. The Action owns the shrink boundary and a
full-label tooltip; its public Text owns the ellipsis. Keep the nested Text when
updating the label at runtime, and update the tooltip to the complete value.
Default actions continue to wrap. See the long-label catalogue specimen and
test/design-system-action-truncate.test.tsx.
Button.logo={{src}} opts into a named brand choice. It replaces the visible
label with an 80×24 contained image on a 112×48 minimum stage, keeps label as
the accessible name/tooltip, and shows a check icon when pressed. Consumers
own selection and ordering; the public component owns geometry, frame, focus
and original brand colours on white in both themes. Ordinary controls are unchanged.
See test/design-system-logo-button.test.ts and the Button specimen.
ModalSheet.size="workspace" fills the available viewport width inside the
desktop overlay margin. It preserves the existing fullscreen phone behavior,
native close route, focus return and height="fixed" bands. Layer clipping
prevents focus/fragment navigation from scrolling the title or footer away;
the body retains its scroll. See test/design-system-workspace-modal.test.ts.
Menu label entries expose a stable ${menuId}-${entryId}-label ID and optional
hidden state. A filtered menu can toggle its empty message inside the owned
panel without moving unrelated page content into the popup. The consumer owns
search results and live announcements; the Menu owns the label's spacing and
typography. See test/design-system-menu-label.test.tsx.
Menu choices and headings wrap long words within the panel. The shared runtime
measures the trigger and enclosing scroll regions, keeps the popup inside their
visible bounds, and opens above when more room is available. Resize updates the
measurement; closing/disposal clears it. The native disclosure remains available
without JavaScript. See test/design-system-menu-fit.test.ts.
Menu takes triggerAppearance="plain" when its trigger content draws the
face itself, such as an avatar or a tile matching the plain tiles beside it.
The trigger keeps its name, disclosure semantics, focus ring and panel but
drops the button frame, padding and fill, also at size="compact". Style the
trigger content, never [data-ui="menu-trigger"]. See
test/design-system-menu-trigger.test.tsx.
Keyboard navigation skips hidden and disabled Menu choices after filtering.
A disabled trigger blocks activation and navigation keys while preserving Tab
and Escape. See test/design-system-menu-keyboard.test.ts.
#API
Generated from the package source. A property without a description has none in the source yet.
#AppNavigationComponent
| Property | Description | Type | Default |
|---|---|---|---|
idrequired | – | string | – |
labelrequired | – | string | – |
identity | – | JSXChild | – |
externalTrigger | A topbar may provide NavigationToggle while this component owns the drawer. | boolean | – |
groupsrequired | – | readonly NavigationGroupData[] | – |
context | – | JSXChild | – |
supplementary | – | JSXChild | – |
footer | – | JSXChild | – |
navigationSlot | – | string | – |
menuLabel | – | string | 'Menu' |
closeLabel | – | string | 'Close navigation' |
open | – | boolean | – |
tools | – | NavigationToolsProps | – |
#NavigationDrawerComponent
| Property | Description | Type | Default |
|---|---|---|---|
idrequired | – | string | – |
labelrequired | – | string | – |
identity | – | JSXChild | – |
groupsrequired | – | readonly NavigationGroupData[] | – |
context | – | JSXChild | – |
supplementary | – | JSXChild | – |
footer | – | JSXChild | – |
navigationSlot | – | string | – |
closeLabelrequired | – | string | – |
tools | – | NavigationToolsProps | – |
#NavigationGroupComponent
| Property | Description | Type | Default |
|---|---|---|---|
exclusive | False allows multiple branches to remain open, including nested branches. | boolean | – |
idrequired | – | string | – |
label | – | string | – |
itemsrequired | – | readonly NavigationItemData[] | – |
caret | Branches without their own leading icon show a caret in the leading column that turns when the branch opens. Suits long lists of collapsed sections, such as API references. | boolean | – |
branchGroup | – | string | – |
#NavigationHeaderComponent
| Property | Description | Type | Default |
|---|---|---|---|
identity | – | JSXChild | – |
context | – | JSXChild | – |
closeLabelrequired | – | string | – |
searchId | – | string | – |
controls | – | string | – |
tools | – | NavigationToolsProps | – |
#NavigationItemComponent
| Property | Description | Type | Default |
|---|---|---|---|
idrequired | – | string | – |
labelrequired | – | string | – |
leading | – | JSXChild | – |
description | – | string | – |
count | – | number | – |
href | – | string | – |
active | – | boolean | – |
children | – | never | – |
expanded | – | never | – |
#NavigationTriggerComponent
| Property | Description | Type | Default |
|---|---|---|---|
controlsrequired | – | string | – |
labelrequired | – | string | – |
identity | – | JSXChild | – |
open | – | boolean | – |
#NavigationToggleComponent
| Property | Description | Type | Default |
|---|---|---|---|
controlsrequired | – | string | – |
labelrequired | – | string | – |
#Types
#AppNavigationProps
The properties of AppNavigation, listed above.
#NavigationToolsProps
| Property | Description | Type | Default |
|---|---|---|---|
searchLabelrequired | – | string | – |
searchPlaceholderrequired | – | string | – |
emptyLabelrequired | – | string | – |
collapseLabelrequired | – | string | – |
#NavigationGroupData
| Property | Description | Type | Default |
|---|---|---|---|
exclusive | False allows multiple branches to remain open, including nested branches. | boolean | – |
idrequired | – | string | – |
label | – | string | – |
itemsrequired | – | readonly NavigationItemData[] | – |
caret | Branches without their own leading icon show a caret in the leading column that turns when the branch opens. Suits long lists of collapsed sections, such as API references. | boolean | – |
#NavigationItemData
The properties of NavigationItem, listed above.
#Hooks
The data-ui values these components render. Select them in tests and behaviour; their look belongs to the design system. See Contract.
app-navigationnavigation-triggernavigation-togglenavigation-trigger-iconnavigation-trigger-identitynavigation-trigger-labelnavigation-layernavigation-backdropnavigation-drawernavigation-headernavigation-identitynavigation-contextnavigation-closenavigation-groupsnavigation-groupnavigation-group-labelnavigation-itemsnavigation-supplementarynavigation-itemnavigation-branchnavigation-branch-triggernavigation-childrennavigation-item-leadingnavigation-item-copynavigation-item-labelnavigation-item-descriptionnavigation-item-countnavigation-footernavigation-toolsnavigation-search-togglenavigation-searchnavigation-search-inputnavigation-search-emptynavigation-collapse