Skip to main content
urbicon ui

DocsLayout

Documentation page layout with header hero, sticky table of contents, scrollspy, and a responsive content column.

01 Examples

Page-level layout, shown as code

Basic page

Title, description, and a ToC built from the page's own sections: every titled Section is listed under its heading, in the order it renders, with no list to keep beside it.
<DocsLayout
  title="Badge"
  description="Status and labels"
  maxWidth="lg"
  showToc
>
  <Section marker id="examples" title="Examples">...</Section>
  <Section marker id="api" title="API Reference">...</Section>
</DocsLayout>

Collapsing hero with breadcrumbs

Passing breadcrumbs enables the sticky-bar pattern: crumbs + code toggle first, then a compact bar with title and scrollspy once the header scrolls away. stability and sourceHref render the editorial badge and source link.
<DocsLayout
  title="Combobox"
  description="Searchable single-select input"
  breadcrumbs={[
    { label: 'Blocks', href: '/blocks' },
    { label: 'Primitives', href: '/blocks/primitives' }
  ]}
  stability="stable"
  sourceHref="https://example.com/blob/main/Combobox.svelte"
  showToc
>
  <Section id="playground" title="Playground">...</Section>
</DocsLayout>

02 Accessibility

The landmarks a page gets for free

The layout renders the page's <main>, the table of contents as a named <nav>, and the breadcrumb strip as a second one. A page built on it therefore starts with a complete landmark set — which is why hand-rolling a breadcrumb row instead of passing breadcrumbs costs more than the sticky bar.

Scroll-spy marks, it does not move focus

Scrolling sets aria-current="location" on the active table-of-contents link and changes nothing else. Focus stays where the reader put it — dragging it along with the scroll position would make the page unusable with a keyboard.

The collapsing hero keeps its heading

When the header scrolls away the compact bar takes over visually, but the page's <h1> stays in the document — the bar is a second presentation of it, not a replacement. A screen reader still finds one, and only one, top-level heading.

Reader-controlled code visibility

The code toggle in the header is a real control with aria-pressed, and every CodeExample on the page follows it. Someone who reads code rather than previews sets it once instead of expanding each example.

03 API Reference

16 props
16 props
Prop
Type
Default
Description

04 Types

6 types
Name
Kind
Category
Used by
Description

05 Installation

Import

import { DocsLayout } from '@urbicon-ui/docs';