Krizaka UI
Krizaka UI

List

Records read top to bottom — a leading visual, a title and a line, details and actions beside — dense or comfortable, selectable, windowed when long.

Web · ✓Mobile · ✓Bureau · ✓BêtaAffichage de données
Niveau de support
Bêta
Taille
5.4 kB gzip, budget 8.0 kB
Qui l'utilise
14 fichiers des produits et sites en production l'importent (Verikora : 10, Folioviv : 1, Sovkora : 3) Compté dans l'inventaire daté du 2026-11-23.
import { List } from "@krizaka/ui/list";

Web et mobile — le même composant pour React et React Native. Bêta : son API peut encore changer à une version mineure.

Pourquoi il est là. Used by Sovkora, Verikora, Folioviv.

Quand l’utiliser

  • Sovkora's jobs, a story's viewers and tippers, a creator's payouts.
  • A long feed on a phone: sections by day, pull to refresh, swipe actions (React Native).

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 { List } from "@krizaka/ui/list";

Exemples

Jobs

Sovkora's jobs, each row opening its run, the status beside it.

Selectable, compact

A story's viewers, picked for a thank-you.

2,000 rows

virtualize: only the rows in view are rendered.

Props

A list of records: dense or comfortable, selectable, actions beside each row, windowed when long, with its states.

PropTypeDéfautDescription
aria-labelrequisstring—The list's accessible name (“Jobs”).
getIdrequis(item: T) => string—A stable id per record: the React key and the selection's value.
itemsrequisreadonly T[]—The records, in order.
rowrequis(item: T) => ListRow—What a record shows: its title, line, visuals, details, actions and where it leads.
chevronsboolean—Shows a chevron on the rows that lead somewhere.
classNamestring—Classes merged on the root.
defaultSelectedreadonly string[][]The ids selected at first, uncontrolled.
density"compact" | "comfortable"—comfortable (default: 64 px rows with a line) · compact (44 px: dense admin lists).
emptyReactNode—Shown when there is no record (an EmptyState).
errorReactNode—A failure in place of the rows (an Alert with a retry); announced.
footerReactNode—Under the list: a Pagination, a “Load more” button, a total.
labelsPartial<ListLabels>—The words, passed translated; English by default.
loadingboolean—Loading: loadingRows skeleton rows and aria-busy.
loadingRowsnumber5How many skeleton rows. Default 5.
onSelectedChange((selected: string[]) => void)—Called with the new selection.
selectableboolean—A checkbox per row.
selectedreadonly string[]—The ids selected (controlled).
virtualize{ rowHeight: number; height: number; overscan?: number; }—Renders only the rows in view: fixed rowHeight, a scrolling region of height px.

Accessibilité

  • A ul named by aria-label; the main action fills the row without nesting the others.
  • A windowed list is a scrolling region the keyboard can reach.
  • On React Native, swipe actions are also accessibility actions.

Clavier

TouchesAction
TabMoves through the rows' main actions, their checkboxes and their secondary actions.

Bonnes pratiques

  • One main action per row (a link or onSelect); secondary actions go in actions, beside it.
  • Show loading for the first page only; the next pages go in footer (a “Load more” button, a Pagination).
  • Past a few hundred rows, virtualize with a fixed row height.

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

Sur cette page