Krizaka UI
Krizaka UI
Composants

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.

Web · ✓Mobile · n/aBureau · ✓BêtaAffichage de données
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 tailwindcss

Styles

@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.

PropTypeDéfautDescription
actionLabelrequisstring—The words of the way in (Book, Choose): the accessible name of the press.
namerequisstring—The service's name (the heading).
pricerequisstring—Its price, formatted by the app (22,00 $): the card never formats money.
capacitystring—How many it takes (Up to 5 dogs, 1 person) — the second fact.
density"grid" | "list"gridvariant="index": list lays the card out as a row for a single column (the media on the left from sm).
descriptionstring—One or two sentences: what it is.
durationstring—How long it takes (30 min) — the first fact.
hrefstring—The way in, as an address (the booking page with this service preselected).
iconReactNode—An icon tile before the name (a signature icon): decorative.
includedreadonly string[]—What is included, one short line each (a check precedes it).
linkAsLinkComponent—The app's link component for internal addresses (Next's Link).
mediaReactNode—A photo or a loop above the card (an img, a video): fills a 16:9 band.
priceFromstring—The words before the price when it varies (From, À partir de), passed translated.
revealnumber—Enters on scroll (MotionObserver): the index in the grid becomes the delay.
selectedboolean—This service is the chosen one (the accent, data-selected).
tagstring—A tag on the top right (Popular): only from real data, never decoration.
titleAs"h2" | "h3" | "h4"h3The heading level of the name.
variant"default" | "index"defaultindex — 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 article named 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 onSelect the button carries aria-pressed (the chosen service).

Clavier

TouchesAction
Tab, EnterFocuses 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 priceFrom only when the price truly varies; keep included to 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 href to the booking page with the service in the address.
  • Put the cards in a CardGrid so a row shares one height.

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

Sur cette page