Krizaka UI
Krizaka UI
Composants

Account settings

The blocks of an account page, so every app has the same polished one: the identity card (picture, name, verified e-mail, member since), a picture grid to choose from, a labelled language control, selectable cards for a single choice — beside SettingsSection's one inline save.

Web · ✓Mobile · ✗ à construireBureau · ✓BêtaFormulaires
import { AccountProfileCard, AvatarPicker, ChoiceCards, LanguagePicker, AppearanceSettings } from "@krizaka/ui/account-settings";

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

  • Mobile · ✗ à construire. The Expo apps get the same blocks on @krizaka/ui/native. issue #503

Pourquoi il est là. Used by Yomizaka, Akinaza.

Quand l’utiliser

  • The profile page of any Krizaka app (a product's /settings/profile, the future @krizaka/auth).
  • ChoiceCards for any single choice that deserves a sentence each: a side, a plan, a way to be answered.

Quand ne pas l’utiliser

  • A choice between a few short words (a view, a size).À la place : Radio group
  • A set of tiles that lead somewhere or show a line-up.À la place : Choice grid
  • The language of a public page: it is a link to the same page in the other language.À la place : Language switch

Installation

Installer

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

Styles

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

Importer

import { AccountProfileCard, AvatarPicker, ChoiceCards, LanguagePicker, AppearanceSettings } from "@krizaka/ui/account-settings";

Exemples

Profile page

A whole profile section: identity, name, pictures, language, side — one save, dirty then saved with Undo.

Avatar picker

The family's default pictures as one radio group, the upload beside them.

Choice cards

A single choice as two cards with an icon, a title and a line.

Language picker

Labelled, native names.

Appearance

Theme cards (live miniatures, one check), accent, density and language as settings rows; applied at once with useAppearance().

Section patterns

Security, subscription, storage and my data as flat sections of rows.

Props

AccountProfileCard

The account's identity card: picture, name, verified e-mail, member since.

PropTypeDéfautDescription
emailrequisstring—The e-mail address.
namerequisstring—The name (the card's heading).
unverifiedLabelrequisstring—“Not verified” — passed translated.
verifiedrequisboolean—Whether the address is verified.
verifiedLabelrequisstring—“Verified” — passed translated.
actionReactNode—Beside the picture: the change action (a Button).
avatarPick<AvatarProps, "src" | "fallback" | "defaultAvatar">—The picture: the person's photo, or the default avatar of the brand.
compactbooleanfalseOne calm line for a settings row: a medium picture beside the name and the e-mail, no wrapping.
memberSincestring—“Member since October 2026” — formatted by the app, in the viewer's language.

AppearanceSettings

The appearance rows of a settings page: theme cards, accent, density, language, sound.

PropTypeDéfautDescription
onThemeChangerequis(id: string) => void—Called with the id chosen.
themerequisstring—The id of the theme chosen.
themesrequisreadonly ThemeCardOption[]—The themes offered: at least system, light and dark.
accentstring | null—The id of the accent chosen; null for the product's own.
accentsreadonly AccentOption[]—The accents offered (the product's own first). Without it the row is not shown.
classNamestring—Classes merged on the root.
densitiesreadonly { value: string; label: string; }[]—The densities offered, with their names (standard, compact).
densitystring—The density chosen.
labelsPartial<AppearanceLabels>—The words, passed translated (English by default).
languagestring—The code of the language chosen.
languagesreadonly LanguageOption[]—The languages offered, each named in its own language.
onAccentChange((id: string) => void)—Called with the id chosen.
onDensityChange((density: string) => void)—Called with the density chosen.
onLanguageChange((code: string) => void)—Called with the code chosen.
onSoundChange((on: boolean) => void)—Called with the new state.
soundboolean—Shown only when given: the sound is opt-in.

AvatarPicker

A grid of pictures to choose from, with an upload beside them: a radio group, never a row of loose radios.

PropTypeDéfautDescription
labelrequisstring—The group's accessible name (“Profile picture”) — passed translated.
optionsrequisreadonly AvatarOption[]—The pictures.
densebooleanfalseSmaller tiles, for a settings row.
descriptionReactNode—One line under the visible label: what it changes.
onValueChange((value: string) => void) | ((id: string) => void)—The viewer chooses another picture.
showLabelboolean—Shows the label above the grid, with description under it.
uploadReactNode—After the pictures, in the grid: the upload action (a Button, a file input's label). Not a radio.
valuestring | null—The chosen id (controlled).

ChoiceCards

Cards to choose one from: a radio group where each card has an icon, a title and a description.

PropTypeDéfautDescription
labelrequisstring—The question (“Which side of the lease are you?”) — the group's accessible name, passed translated.
optionsrequisreadonly ChoiceCardOption[]—The choices.
descriptionReactNode—One line under the visible question.
invalidboolean—Marks every radio invalid: aria-invalid (pair it with a Field.Error).
onValueChange((value: string) => void) | ((id: string) => void)—The viewer chooses another picture.
routeKeystring—Binds the choice to this search parameter of the URL (?kind=…): the URL is the state — for a view's selection (a segmented switch), not a form field.
routeValuesreadonly string[]—The values the parameter may hold (the radios' values); the first is the default unless defaultValue says otherwise.
showLabelboolean—Shows the question above the cards, with description under it.
valuestring | null—The chosen id (controlled).

LanguagePicker

The language control of an account page: a labelled segmented choice, native names.

PropTypeDéfautDescription
labelrequisReactNode—The visible label (“Language”) — passed translated.
languagesrequisreadonly LanguageOption[]—The languages offered.
descriptionReactNode—One line under it: what it changes.
invalidboolean—Marks every radio invalid: aria-invalid (pair it with a Field.Error).
onValueChange((value: string) => void) | ((id: string) => void)—The viewer chooses another picture.
routeKeystring—Binds the choice to this search parameter of the URL (?kind=…): the URL is the state — for a view's selection (a segmented switch), not a form field.
routeValuesreadonly string[]—The values the parameter may hold (the radios' values); the first is the default unless defaultValue says otherwise.
showLabelbooleantrueShows the label above the control; false when a SettingsRow already says it (the group keeps its accessible name).
valuestring | null—The chosen id (controlled).

Accessibilité

  • Each group is a named radiogroup; the chosen item says aria-checked, shows a ring and a check (not colour alone).
  • A card's description is its aria-describedby; a picture is named by its label, not its image.
  • The save result is a polite live region that stays mounted; a failure is role="alert".

Clavier

TouchesAction
← → ↑ ↓Moves to the next picture, card or language and chooses it (one tab stop per group).
SpaceChooses the focused one.
Enter (in a field)Submits the section's form: saves when it is dirty.

Bonnes pratiques

  • One save per section (SettingsSection save): enabled while the section is dirty, « Saved » and Undo after it, the failure as an alert. Never a save above the fields.
  • AvatarPicker is one radiogroup — never a row of circles with loose radios; keep the upload inside its grid, after the pictures.
  • Name every language in its own language and label the control: « Langue », never an unlabelled switch.
  • Pass every word translated; the member-since date is formatted by the app in the viewer's language.
  • Appearance: pass the themes the product offers (system, light, dark, then Blueprint and Carbone if wanted — never a paper theme inside a signed-in product) from appearance of @krizaka/tokens, and only the accents that read on all of them (appearance.passes). The change applies at once (useAppearance() of @krizaka/ui/theme, restored before paint by ThemeScript); save it in the account too so it follows the person. Sound is opt-in, off by default, never under reduced motion; density is html[data-density].
  • Section patterns (security, subscription, storage, my data) are flat sections of SettingsRows: the billing portal is one link, the export one button, the delete a ConfirmButton.

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