Krizaka
Documentation

Match dialog

The moment two people choose each other — a match, a pair, a deal: the two avatars meet at a heart in the brand gradient, the next step under them.

Web + MobileBêtaSuperpositions

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

Quand l’utiliser

  • A mutual like in a dating app.
  • Two parties agree: a deal, a duo for a challenge.

Quand ne pas l’utiliser

  • To confirm an action.À la place : Dialog
  • For a passing confirmation.À la place : Toast

Installation

Installer

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

Styles

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

Importer

import { MatchDialog } from "@krizaka/ui/match-dialog";

Exemples

It's a match

Opened at load: the two avatars, the message button.

Props

Two people choose each other: the avatars meet at a heart in the brand gradient, the next step under them.

PropTypeDéfautDescription
onOpenChangerequis(open: boolean) => void—Called when it closes.
onPrimaryrequis() => void—What it does.
openrequisboolean—Shown (controlled).
peoplerequisreadonly [{ src?: string | null | undefined; name: string; }, { src?: string | null | undefined; name: string; }]—The two people: avatar URLs and names.
primaryLabelrequisstring—The main action (“Send a message”).
secondaryLabelrequisstring—The way back (“Keep swiping”).
titlerequisstring—The headline (“It's a match!”) — passed translated; the dialog's name.
descriptionstring—A line under it.

Accessibilité

  • A dialog named by its title, announced when it opens; a success tick on React Native.
  • The entrance is skipped under reduced motion.

Clavier

TouchesAction
EscCloses it (the way back).

Bonnes pratiques

  • Offer the next step first (“Send a message”), and a way back.
  • Keep it rare: it is a celebration.

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

Sur cette page