Krizaka
Documentation

Docs layout

A documentation page in the site's frame: the pages, the article and its contents on a wide screen; on a phone the pages fold into a disclosure above the article.

WebBetaLayouts

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

When to use

  • A documentation without a docs engine, or around one.
  • Guides and references of a product.

When not to use

  • For a reading page of a site without a list of pages.Use instead: Table of contents
  • For a hub of entry points.Use instead: Link card

Installation

Install

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

Styles

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

Import

import { DocsLayout } from "@krizaka/ui/docs-layout";

Examples

A documentation page

Pages, an article with two headings, its contents.

Pages of the documentation

Getting started

Install

npx orazaka install

Props

A documentation page: pages · article · contents, in the site's frame.

PropTypeDefaultDescription
sidebarrequiredReactNode—The pages of the documentation (a nav of links, grouped).
sidebarLabelrequiredstring—On a phone the sidebar is folded: the words that open it (Pages of the documentation).
tocReactNode—The page's table of contents (a Toc of @krizaka /ui/toc): beside the article from xl.

Accessibility

  • The pages are your nav; on a phone the same nav sits in a native details.
  • The article is an article; the contents a Toc.

Keyboard

KeysAction
Enter / SpaceOn a phone, opens or closes the list of pages.

Best practices

  • The frame of the docs is wider (--kz-page-max-docs): give the bar the same width on these pages.
  • Keep the article under 48rem; the contents list three to eight headings.

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

On this page