GitHub

Section Layout

Page heading with its own sub-navigation, such as settings or account pages.

Adapted from the shadcn-admin settings page. The sections are Tabs in a side column from the lg breakpoint, on a rail between them and the content. The column is a fifth of the page wide but held between 192 and 256px; below lg the tabs are a scrolling row above the content. Choosing one calls the layout's onNavigate, and the tabs take their accessible name from title.

Loading example…

Installation

pnpm dlx shadcn@latest add @sui/section-layout

Usage

import { SectionLayout } from "@workspace/ui/layouts/section-layout"

<AppMain fixed>
  <SectionLayout title="Settings" description="Manage your account." items={items}>
    <Outlet />
  </SectionLayout>
</AppMain>

Inside an AppShell, links and active state come from its currentPath and linkComponent. Elsewhere, wrap the page in LayoutProvider with the same props.

Horizontal

orientation="horizontal" shows the tabs between the heading and the content at every size; they scroll when they outgrow the page. Use it for a few short sections.

Loading example…

API

PropDefaultDescription
titleRequiredPage heading.
description—Text under the heading.
actions—Controls for every section, such as a date range or a primary action, at the end of the heading row.
itemsRequiredLinks { title, href, icon?, disabled? }.
orientation"vertical""vertical" stands the tabs in a side column from lg up; "horizontal" keeps them above the content.

The content is a flex column, so a list in a fixed-height AppMain scrolls inside it and keeps its pagination in view.

SectionTabs renders the tabs alone, with orientation for a column. SectionNav renders the earlier link navigation: links from lg up, a scrolling row on tablets and a select on phones.