Krizaka UI
Krizaka UI
Patrons

App frame

The one signed-in frame of a Krizaka web product: the rail (a bottom tab bar on a phone), the family's top bar and the account menu, composed from data — sections, account and the primary action. The frame owns what must not differ between products: the account menu's content and order, the preferences living in the menu, a place being on the rail or under the avatar, never both.

Web · ✓Mobile · n/aBureau · ✓BêtaMises en page
import { AppFrame, navWords, publicBarLinks, framePlaces } from "@krizaka/ui/app-frame";

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

  • Mobile · n/a. On a phone the frame is a tab bar, a header and a screen: the native twin is the tabs shell template. → Tab bar

Pourquoi il est là. The one signed-in frame of Yomizaka, Akinaza and Orazaka (UX audit F1, F2; yomizaka#429, akinaza#396, orazaka-web-client#294).

Quand l’utiliser

  • Every signed-in screen of a product: Yomizaka, Akinaza, Orazaka — and each one's administration (variant="admin").
  • When a fourth product needs the frame: write its sections, not another header.

Quand ne pas l’utiliser

  • A console with grouped sections, counts and keyboard shortcuts in a collapsing sidebar of words.À la place : App shell
  • A public page of a site.À la place : Nav bar
  • A desktop window (Tauri) with a title bar.À la place : App shell

Installation

Installer

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

Styles

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

Importer

import { AppFrame, navWords, publicBarLinks, framePlaces } from "@krizaka/ui/app-frame";

Exemples

A product's signed-in app

Yomizaka: four sections with a count, the search, the primary action « Check a document », and the account menu with Language and Theme.

The administration

variant="admin" in French: the same frame, a chip that says where you are, and no way into the administration offered again.

Props

The signed-in frame: sections, account and the primary action in; the rail, the top bar and the account menu out.

PropTypeDéfautDescription
accountrequisAppFrameAccount—Who is signed in, the places under their avatar and Sign out.
childrenrequisReactNode—The page, inside RailNav.Body under the top bar.
homeHrefrequisstring—Where the mark and the name lead (/app).
markrequisReactNode—The product's mark (<ProductLogo id="yomizaka" size={26} />): on the rail on a desktop, in the top bar on a phone.
namerequisstring—The product's name, as text in the top bar.
sectionsrequisreadonly FrameSection[]—The destinations. place: "foot" puts one at the rail's foot; gated leaves one out for this person.
accentBrandId—The product's brand: scopes its colours over the rail.
chipsReactNode—Chips beside the name (Dev, Local · Sovereign).
currentIdstring—The id of the section the person is in.
headerMarkReactNode—The mark in the top bar below md (smaller). Defaults to mark.
labelstring—The rail's accessible name. Defaults to the product's name.
languageAppFrameLanguage—The language row of the account menu; absent for a product with one language.
linkAsElementType<any, keyof IntrinsicElements>—The router's link component (Next's Link) for the rail and the menu.
localestringenen or fr: the words of the shared vocabulary.
notificationsReactNode—Notifications: an AppHeaderCount, or the trigger of the host's popover.
primaryReactNode—The one primary action of the app (« Check a document »).
search{ label: string; onOpen: () => void; }—The search (⌘K): opens the app's command palette.
themefalse | AppFrameTheme—The theme row. By default the ThemeProvider's; pass false for a product that has none.
variant"app" | "admin"appadmin: the administration's frame — a chip says so, and the way into it is not offered again.
wordsPartial<NavWords>—Overrides of the shared words, for a product that needs one different (use sparingly).

Accessibilité

  • The rail is a nav named by label; the current section carries aria-current="page".
  • Exactly one brand mark is visible at every width (the rail's on a desktop, the top bar's on a phone).
  • A count on a section is said in words with badgeLabel.

Clavier

TouchesAction
TabMoves through the rail's items, the search, the primary action and the account menu.
↑ ↓ (rail) · ← → (tab bar)Moves between the rail's items.
Enter / Space / Arrow downOpens the account menu; Arrow right opens Language or Theme, Esc goes back.
⌘K / Ctrl+KOpens the search (the host's command palette).

Bonnes pratiques

  • Pass the sections the product has: place: "foot" puts one at the rail's foot; gated leaves one out for this person (a permission, a feature not open). Five main sections at most: a phone's tab bar carries five.
  • The account menu is fixed: identity, Profile, Settings, Billing (only when you pass it), Administration (only for an admin), then Language and Theme, then Sign out. Settings is one entry that lands on the settings home, never a tab.
  • A place is on the rail or under the avatar, never both: a section with the id of an account link (settings, billing) leaves the rail.
  • The theme and the language are always in the menu, never in the header: a phone's header has no room. The theme is the ThemeProvider's unless you pass theme.
  • Say the shared words with the shared vocabulary (navWords, EN/FR): Docs, Terms / Conditions d'utilisation, Settings / Réglages. Override one (words) only when the product truly says it otherwise (« Credits and usage »).
  • The public bar is the other half of the family: publicBarLinks gives its flat links, four at most — How it works · Pricing · Docs · Download.
  • The page inside is <main id="content">; the frame does not draw it.

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

Sur cette page