Krizaka UI
Krizaka UI

Table of contents

The sections of a reading page: sticky beside the content on a wide screen, a row of chips that scrolls sideways on a phone, the section being read marked — with TocLayout to place it.

Web · ✓Mobile · n/aDesktop · n/aBetaBlocks
Support level
Beta
Size
1.1 kB gzip, budget 0.8 kB
Who uses it
4 files of the live products and sites import it (krizaka.com: 2) Counted in the dated inventory of 2026-11-23.
import { Toc, TocLayout } from "@krizaka/ui/toc";

Web only — React, from @krizaka/ui/toc. Beta: its API may still change in a minor version.

  • Mobile · n/a. A reading page's sticky contents; a phone screen is short and scrolls.
  • Desktop · n/a. A public site's page, not a window of the Mac app.

Why it is here. Used by krizaka.com.

When to use

  • A long page read in sections: a building block's page, a guide, a policy.
  • When readers jump to one part (install, decisions, status) more than they read from the top.

When not to use

  • For the navigation between pages.Use instead: Nav bar
  • For a short page of two or three screens: the headings are enough.Use instead: Page

Installation

Install

npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcss

Styles

@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";

Import

import { Toc, TocLayout } from "@krizaka/ui/toc";

Examples

A reading page

Three sections, the contents in a sticky column beside them.

Props

Toc

The sections of the page, the one being read marked.

PropTypeDefaultDescription
itemsrequiredreadonly { id: string; label: ReactNode; }[]—The sections, in order: the id of each section's title and its words.
labelrequiredstring—The navigation's name and visible label: On this page.

TocLayout

A reading page: the table of contents in a sticky column on the left, the sections beside it (one column on a phone).

PropTypeDefaultDescription
tocrequiredReactNode—The table of contents (a Toc).

Accessibility

  • A nav named by its label, with an ordered list of links.
  • The section being read carries aria-current="location", found by one IntersectionObserver.

Keyboard

KeysAction
TabMoves through the sections' links; Enter jumps to the section.

Best practices

  • Three to eight entries, the words of the section titles.
  • Every entry points at a heading's id (a Section's): its anchor.
  • Set --kz-anchor-offset once to clear a fixed navigation bar.

Generated from the code of @krizaka/ui 5.3.4: its meta.ts, its examples and its types.Edit this documentation on GitHub

On this page