Krizaka UI
Krizaka UI
Composants

Docs nav

The pages of a documentation in quiet groups: each group folds, the one holding the current page is open, only the current page is marked.

Web · ✓Mobile · n/aBureau · n/aBêtaNavigation
import { DocsNav } from "@krizaka/ui/docs-nav";

Web uniquement — React, depuis @krizaka/ui/docs-nav. Bêta : son API peut encore changer à une version mineure.

  • Mobile · n/a. Documentation is read on the sites, not inside an app.
  • Bureau · n/a. A public site's page, not a window of the Mac app.

Pourquoi il est là. Groups the pages in the documentation sidebar.

Quand l’utiliser

  • The sidebar of a DocsLayout or DocsArticlePage.
  • A documentation with two or more audiences (a guide, a reference) that must not be mixed.

Quand ne pas l’utiliser

Installation

Installer

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

Styles

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

Importer

import { DocsNav } from "@krizaka/ui/docs-nav";

Exemples

A guide and a reference

Two groups, the second page current.

Props

The pages of the documentation in groups; the group of the current page is open, the others fold.

PropTypeDéfautDescription
groupsrequisreadonly DocsNavGroup[]—The groups, in order.
labelrequisstring—The navigation's accessible name (Documentation).
currentstring—The href of the page being read.
linkAsLinkComponent—The app's link component (Next's Link).

Accessibilité

  • A nav named by label; the current page carries aria-current="page".
  • Groups are native details: they work without script.

Clavier

TouchesAction
Enter / SpaceOpens or closes a group.
TabWalks the links of the open groups.

Bonnes pratiques

  • Titles of one line: shorten them, the page's own title says the rest.
  • No icon and no emoji: the active page is the only thing that stands out.

Générée depuis le code de @krizaka/ui 3.63.1 : son meta.ts, ses exemples et ses types.Modifier cette documentation sur GitHub

Sur cette page