Krizaka UI
Krizaka UI
Components

Photo grid

A profile's photos in slots: the first is the main one, empty slots invite to add, photos reorder by drag (web), by their menu (React Native) or by buttons — every move announced.

Web + MobileBetaMedia

Web and mobile — the same component for React and React Native. Beta: its API may still change in a minor version.

Why it is here. Yasakia's people screens (PY3/PY4) and Orochia's creator pages.

When to use

  • A dating profile's photos, the first one shown first.
  • A product's gallery to order before publishing.

When not to use

Installation

Install

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

Styles

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

Import

import { PhotoGrid } from "@krizaka/ui/photo-grid";

Examples

Profile photos

Three photos, the first main, two required.

Elena at the beach
Elena with her guitar
Elena at a concert

Props

A profile's photos in slots: drag to reorder, or each photo's buttons (earlier, later, remove), every move announced.

PropTypeDefaultDescription
labelsrequiredPhotoGridLabels—The words, passed translated.
onValueChangerequired(photos: GridPhoto[]) => void—Called with the new order, or without a removed photo.
valuerequiredreadonly GridPhoto[]—The photos, in order: the first is the main one.
classNamestring—Classes merged on the root.
columnsnumber3Columns. Default 3.
onAdd(() => void)—Called by an empty slot: open the file picker, the camera, the editor.
requirednumber1Fewest photos required: the empty slots up to it are marked. Default 1.
slotsnumber6How many slots. Default 6.

Accessibility

  • Each photo is named by its position and words, the main one says so.
  • Every move is announced; React Native offers the same moves as accessibility actions.

Keyboard

KeysAction
TabMoves through the photos and their buttons (earlier, later, remove).

Best practices

  • Mark the required slots (required).
  • Open the MediaPicker, the camera or the MediaEditor from onAdd, then add what comes back.

Generated from the code of @krizaka/ui 3.8.0: its meta.ts, its examples and its types.Edit this documentation on GitHub

On this page