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 + MobileBetaOverlays

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

When to use

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

When not to use

  • To confirm an action.Use instead: Dialog
  • For a passing confirmation.Use instead: Toast

Installation

Install

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

Styles

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

Import

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

Examples

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.

PropTypeDefaultDescription
onOpenChangerequired(open: boolean) => void—Called when it closes.
onPrimaryrequired() => void—What it does.
openrequiredboolean—Shown (controlled).
peoplerequiredreadonly [{ src?: string | null | undefined; name: string; }, { src?: string | null | undefined; name: string; }]—The two people: avatar URLs and names.
primaryLabelrequiredstring—The main action (“Send a message”).
secondaryLabelrequiredstring—The way back (“Keep swiping”).
titlerequiredstring—The headline (“It's a match!”) — passed translated; the dialog's name.
descriptionstring—A line under it.

Accessibility

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

Keyboard

KeysAction
EscCloses it (the way back).

Best practices

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

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

On this page