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 driven by the navigation array — each entry's id must match a Section id.
<DocsLayout
  title="Badge"
  description="Status and labels"
  maxWidth="lg"
  showToc
  navigation={[
    { id: 'examples', title: 'Examples' },
    { id: 'api', title: 'API Reference' }
  ]}
>
  <Section id="examples" title="Examples">...</Section>
  <Section 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
  navigation={nav}
>
  <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

Complete list of component properties and their configurations

17 props
Prop
Type
Default
Description

04 Types

Local type definitions used by this component.

6 types
Name
Kind
Category
Used by
Description

05 Installation

Import

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