Krizaka
Documentation

Call-to-action panel

The invitation at the end of a section or a page: a title, why it matters, the ways to answer — in the hue of the page.

WebBêtaBlocs

Web uniquement — React, depuis @krizaka/ui/cta-panel. Bêta : son API peut encore changer à une version mineure.

Quand l’utiliser

  • The end of a page that argued: discuss, propose, contact, get started.
  • The end of a section that asks the reader for something.

Quand ne pas l’utiliser

  • For a message about the state of the app.À la place : Alert
  • For a whole closing section on the brand's gradient.À la place : Page

Installation

Installer

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

Styles

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

Importer

import { CtaPanel } from "@krizaka/ui/cta-panel";

Exemples

Discuss

The end of a building block's page: discuss or propose.

Something to say about it?

A decision you would make differently, a starter you miss: the discussions are open, and every idea gets an answer.

Props

A call to act: title, why, the actions — the closing panel of a section or a page.

PropTypeDéfautDescription
titlerequisReactNode—The invitation: Something to say about it?.
bodyReactNode—Why it matters, in one or two sentences.
level2 | 32The title's level.
revealboolean—Rises once into place ([data-reveal]). Never on the first screen.

Accessibilité

  • Its title is a real heading (h2 or h3): it appears in the page's outline.
  • The tint is decorative; text stays in the text roles (AA).

Bonnes pratiques

  • One invitation per panel, one or two actions (an ActionBar).
  • Say why answering matters to the reader, not to you.
  • Give it an id when other pages link to it (#discuss).

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

Sur cette page