Krizaka UI
Krizaka UI
Components

Versus card

An arcade « character select » card: two subjects face to face, a bird as each fighter, stat bars from real data, and a « VS » between them.

Web · ✓Mobile · ✗ to buildDesktop · ✓BetaBlocks
import { VersusCard } from "@krizaka/ui/versus-card";

Web only — React, from @krizaka/ui/versus-card. Beta: its API may still change in a minor version.

  • Mobile · ✗ to build. It comes with the native paper roles of the Cahier. issue #421

Why it is here. The tool sites (krizaka/krizaka-ui#548): Java's two-release face-off, the component and its alternative on ui.krizaka.com.

When to use

  • To compare two releases of a tool, or a component and its alternative, on measured figures.
  • To open a changelog or a « why this one » page with a playful, honest face-off.

When not to use

  • A feature-by-feature table of three subjects or more.Use instead: Comparison table
  • One subject and its numbers.Use instead: Stat

Installation

Install

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

Styles

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

Import

import { VersusCard } from "@krizaka/ui/versus-card";

Examples

Two releases

Two releases of a package compared on bundle size and coverage.

A component and its alternative

Two ways to build a dialog, compared on measured figures.

Props

An arcade versus card: two subjects face to face, a bird each, stat bars from real data, a « VS » between them.

PropTypeDefaultDescription
labelrequiredstring—The accessible name of the match: Krizaka UI 2.7 versus 2.6.
leftrequiredFighter—The subject on the left.
rightrequiredFighter—The subject on the right (its bird faces left).
sourceReactNode—Where the figures come from, under the card.
vsReactNodeVSThe mark between them.

Accessibility

  • A named section; each fighter's stats are a description list, so every figure is text. The bars repeat the numbers and are hidden from assistive technology.
  • The birds are decoration; the « VS » is real text.
  • On a phone the fighters stack with the mark between them; nothing moves.

Best practices

  • Every bar is a real figure: pass the value, its maximum and the text the reader reads (4.1 kB), and say where the figures come from in source.
  • The same stats, in the same order, on both sides: the card compares, it does not decide who wins.
  • Choose the birds by the brand reference (the duck builds, the owl reads, the pigeon delivers), not by looks.
  • Name the match for assistive technology with label: Krizaka UI 2.7 versus 2.6.

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

On this page