# Flux 2.0 — App shell The frame of a product: a rail of destinations, a top bar and the main column. Reference: https://flux.kaptio.com/components/app-shell/ Requires: https://flux.kaptio.com/tokens/v2/flux.css and flux-components.css ## Use it when Holds every screen of an application in one frame, so moving between areas changes the main column and nothing else. The rail lists destinations in labelled sections and marks the current one; it collapses to its icons on a wide screen and opens as a sheet from the top bar on a narrow one. The top bar carries the search entry point, reached with ⌘K, and the session context. One shell replaces the per-product sidebars that each grew their own width, colour and active state. ## Do not use it when Not for a single task with a start and an end, such as a booking or a setup wizard; give that the Flow header so nothing pulls attention away from finishing it. Not for a marketing page or a deck. Not for switching views of one object; that is Tabs. Not for steps in order; a rail is a set of places, not a sequence. ## Markup ### Shell with sectioned rail
Skip to content
demo / staging OG

Property mapping

Match each supplier property to its Kaptio service before content is imported.

## API - flux-shell (class): The grid. Fills the viewport and holds the rail, the top bar and the main column. - data-flux-shell (attribute): Wires collapse, the narrow sheet and the search shortcut. Requires flux-components.js. - flux-shell--contained (class): Frames the shell at --flux-shell-contained-height for previews and documentation. The search shortcut is not bound, so the host page keeps its own. - data-collapsed (attribute): On flux-shell. Set it at render time to start collapsed, for example from a saved preference. - flux-shell__skip (class): The skip link. Its href names the main column. - flux-shell__rail (class): The nav element. Give it an id for the menu button’s aria-controls and an aria-label with the product name. - flux-shell__product (class): The product link, with flux-shell__mark and flux-shell__product-name inside. - flux-shell__mark (class): The square mark. Set --flux-shell-mark to the product’s accent, such as var(--flux-product-edge). - flux-shell__product-meta (class): Optional span inside the product name, such as Kaptio Edge. - flux-shell__nav (class): The scrolling list of sections. - flux-shell__section (class): One group: a flux-shell__section-label span and a flux-shell__list ul labelled by it. - flux-shell__item (class): A link with an svg icon, a flux-shell__label span and an optional flux-shell__count span. - aria-current="page" (attribute): On the item for the current destination. Fills the item and sets its label in bold. - flux-shell__footer (class): Holds the collapse button, a flux-shell__item with flux-shell__collapse and data-flux-shell-collapse. - flux-shell__topbar (class): The header element. - data-flux-shell-menu (attribute): On a ghost Button with flux-shell__menu, aria-controls and aria-expanded. Shown at 48rem and below. - data-flux-shell-search (attribute): On the flux-shell__search button. Click and ⌘K or Ctrl K dispatch a bubbling flux-shell-search event; open the product’s search in a Modal from it. - flux-shell__actions (class): The end of the top bar: flux-shell__context in mono and an Avatar. - flux-shell__main (class): The main element, with the id the skip link names and tabindex="-1". ## Accessibility - Use nav, header and main, so each region is a landmark. Label the nav with the product name. - Set aria-current="page" on exactly one item, and update it on every client-side navigation. - Label each list by its section label with aria-labelledby, so "Setup, list, 3 items" is announced. - Keep labels in the accessibility tree when collapsed. The rail hides them visually, never with display: none. - Opening the sheet moves focus to the current item; closing it returns focus to the menu button. ## Keyboard - Tab: Skip link first, then the rail, the top bar and the main column, in that order. - Enter: On the skip link, moves focus to the main column. - ⌘K / Ctrl K: Activates the search entry point from anywhere on the page. - Escape: Closes the narrow sheet and returns focus to the menu button. ## Tokens - --flux-shell-rail-width | -rail-collapsed-width | -topbar-height | -search-width | -contained-height - --flux-shell-rail-bg | -topbar-bg | -main-bg | -divider | -backdrop | -sheet-shadow - --flux-shell-padding | -content-padding | -section-gap | -section-label - --flux-shell-item-height | -item-gap | -item-padding-x | -item-radius | -icon-size - --flux-shell-item-text | -item-hover | -item-hover-text | -item-current-bg | -item-current-text | -item-icon | -item-current-icon - --flux-shell-mark | -mark-size ## Do - Name destinations by what the user finds there, such as Requests or Plans, not by the team that owns them. - Remember the collapsed state per user, and render data-collapsed on the server or before first paint so the rail does not jump. - Show a count only when it is work waiting for the user, such as open requests. - Put the page title in the main column’s h1, where it scrolls with the page, and keep the top bar for search and context. ## Do not - Do not number rail items. A rail is a set of places; a sequence belongs in a Flow. - Do not set the rail on a dark or brand ground. It is layer-01, like every other surface around content. - Do not put a count in a pill or a badge. A count is not a status. - Do not hide items for a role by greying them out. Leave them out, or keep them and explain on the destination why it is locked. - Do not animate the rail’s width when it collapses. It changes in one step.