Components
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 and mobile — the same component for React and React Native. Beta: its API may still change in a minor version.
Why it is here. Used by krizaka.com.
When to use
- A mutual like in a dating app.
- Two parties agree: a deal, a duo for a challenge.
When not to use
Installation
Install
npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcssStyles
@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.
| Prop | Type | Default | Description |
|---|---|---|---|
onOpenChangerequired | (open: boolean) => void | — | Called when it closes. |
onPrimaryrequired | () => void | — | What it does. |
openrequired | boolean | — | Shown (controlled). |
peoplerequired | readonly [{ src?: string | null | undefined; name: string; }, { src?: string | null | undefined; name: string; }] | — | The two people: avatar URLs and names. |
primaryLabelrequired | string | — | The main action (“Send a message”). |
secondaryLabelrequired | string | — | The way back (“Keep swiping”). |
titlerequired | string | — | The headline (“It's a match!”) — passed translated; the dialog's name. |
container | HTMLElement | null | — | Where it is drawn (the page's body by default): give an element inside a brand scope (.brand-…) so the dialog wears the brand too. |
description | string | — | 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
| Keys | Action |
|---|---|
| Esc | Closes 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.
Related components
Generated from the code of @krizaka/ui 3.8.0: its meta.ts, its examples and its types.Edit this documentation on GitHub