Service card
A service a shop sells, as a card that argues: icon or photo, name, duration, capacity, price (« from » when it varies), what is included, a « Popular » tag — and one way in, the whole card pressable.
import { ServiceCard } from "@krizaka/ui/service-card";Web uniquement — React, depuis @krizaka/ui/service-card. Bêta : son API peut encore changer à une version mineure.
- Mobile · n/a. A shop's public storefront is a web page; the apps book through their own lists. → List
Pourquoi il est là. Used by Akinaza.
Quand l’utiliser
- A shop's page: the services it sells, each with its price and a way to book it.
- Any priced offer with a duration and a few inclusions (a class, a treatment, a package).
Quand ne pas l’utiliser
- Plans compared side by side with a feature table.À la place : Pricing page
- A card that only leads somewhere (no price).À la place : Link card
- An argument with a bird and a long version.À la place : Argument card
Installation
Installer
npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcssStyles
@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";Importer
import { ServiceCard } from "@krizaka/ui/service-card";Exemples
Stamped index cards
variant="index": ruled, straight, a punched hole, the duration and the price as stamps, a secondary button.
Index cards in one column
density="list": the same card as a row, for a menu of services.
Services
A solo walk marked Popular and a group walk priced « from »: duration, capacity, inclusions, one way in each.
Props
A service as a card: icon or photo, duration, price, what is included, the capacity, a tag — one way in.
| Prop | Type | Défaut | Description |
|---|---|---|---|
actionLabelrequis | string | — | The words of the way in (Book, Choose): the accessible name of the press. |
namerequis | string | — | The service's name (the heading). |
pricerequis | string | — | Its price, formatted by the app (22,00 $): the card never formats money. |
capacity | string | — | How many it takes (Up to 5 dogs, 1 person) — the second fact. |
density | "grid" | "list" | grid | variant="index": list lays the card out as a row for a single column (the media on the left from sm). |
description | string | — | One or two sentences: what it is. |
duration | string | — | How long it takes (30 min) — the first fact. |
href | string | — | The way in, as an address (the booking page with this service preselected). |
icon | ReactNode | — | An icon tile before the name (a signature icon): decorative. |
included | readonly string[] | — | What is included, one short line each (a check precedes it). |
linkAs | LinkComponent | — | The app's link component for internal addresses (Next's Link). |
media | ReactNode | — | A photo or a loop above the card (an img, a video): fills a 16:9 band. |
priceFrom | string | — | The words before the price when it varies (From, À partir de), passed translated. |
reveal | number | — | Enters on scroll (MotionObserver): the index in the grid becomes the delay. |
selected | boolean | — | This service is the chosen one (the accent, data-selected). |
tag | string | — | A tag on the top right (Popular): only from real data, never decoration. |
titleAs | "h2" | "h3" | "h4" | h3 | The heading level of the name. |
variant | "default" | "index" | default | index — the Cahier's stamped index card: a ruled card with a punched hole, straight, the duration and the price as
stamps, a secondary button. The same props and the same accessible output; only the drawing changes. |
Accessibilité
- An
articlenamed by its heading; the way in is the only tab stop and stretches over the card, so the whole card takes the press. - The link or button is described by the service's name, so « Book » is read with the service it books.
- With
onSelectthe button carriesaria-pressed(the chosen service).
Clavier
| Touches | Action |
|---|---|
| Tab, Enter | Focuses and presses the card's one way in (a link or a button). |
Bonnes pratiques
variant="index"is the Cahier's card for a shop page: same props, same accessible output. Its button is the way in, not the whole card, so the name stays selectable; keep it straight (a card you pick is never askew).- Pass the price already formatted (the shop's currency and the reader's locale): the card never formats money.
- Use
priceFromonly when the price truly varies; keepincludedto three short lines. - Show
tag(« Popular ») only from real data, such as the most booked service — never as decoration. - Give the way in a verb (« Book », « Choose ») and, from a Server Component, an
hrefto the booking page with the service in the address. - Put the cards in a
CardGridso a row shares one height.
Composants liés
Générée depuis le code de @krizaka/ui 3.63.1 : son meta.ts, ses exemples et ses types.Modifier cette documentation sur GitHub