Krizaka
Documentation

Detail layout

One object's page: the way back, its media, name, status, facts and actions, its tabs, the content and a side panel that goes under the content on a phone.

WebBêtaMises en page

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

Quand l’utiliser

  • A video, a job, an account, a pack, an order.
  • Any object reached from a list.

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 { DetailLayout } from "@krizaka/ui/detail-layout";

Exemples

A video

Orochia's video page: thumbnail, status, facts, tabs and the sales beside.

Video · v-2087

Night shoot, part 2

Published
  • 12:48
  • Unlock €4.99
  • 18+ checked
The second half of the night shoot in Old Montréal: the rooftop, the rain, the last take at dawn.

A job

An engine job without tabs or side panel.

Job · job-4822

Podcast transcript

Running
Whisper large · started 5 min ago

The transcript appears here as it is written.

Props

One object's page: header (back, media, name, status, facts, actions), tabs, content and a side panel.

PropTypeDéfautDescription
titlerequisReactNode—The object's name: the h1.
actionsReactNode—The object's actions (edit, publish, a DropdownMenu).
asideReactNode—The side panel: details, related objects, activity (under the content on a phone).
backReactNode—The way back to the list: your router's link (<Link href="/videos">Videos</Link>), drawn with its arrow.
eyebrowReactNode—A mono line above the name (the object's kind, its id).
mediaReactNode—A thumbnail, a cover or an avatar beside the name.
metaReactNode—Under the name: its facts (the author, a date, a count — Facts or plain text).
statusReactNode—Beside the name: its status (a Badge).
tabsReactNode—Under the header: the object's tabs (Tabs.List of @krizaka /ui/tabs, inside your Tabs.Root around the layout).

Accessibilité

  • The name is the page's h1.
  • The side panel is an aside; on a phone it comes after the content in reading order.

Bonnes pratiques

  • The status beside the name, in words (a Badge), not only a colour.
  • Two or three actions at most in the header; the rest in a DropdownMenu.
  • Put the tabs' Tabs.Root around the layout so the content follows the tab.

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

Sur cette page