Krizaka
Documentation

Page hero

The first screen of a page: the way back, an eyebrow, the h1, a lead, what follows them (facts, actions) and an aside (the page's bird) — on the brand's backdrop, painted at once.

WebBêtaBlocs

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

Quand l’utiliser

  • At the top of every page of a site that is not the home: a product's sub-page, a building block, a hub, contact.
  • When the page belongs to a parent (back): the reader always knows where they are and how to go up.

Quand ne pas l’utiliser

  • At the top of an app's screen: a working view needs a calm header.À la place : Page header
  • For a section further down the page.À 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 { PageHero } from "@krizaka/ui/page-hero";

Exemples

A sub-page

Back link, eyebrow, title, lead, facts under it and the page's bird beside it.

Open source

Building block · Java

Krizaka Java

The Spring Boot foundation every Krizaka service starts from: one parent, one BOM, starters that agree.

  • Maven Central 0.1.0
  • Java 21
  • Apache-2.0

A hub

align="center" on the plain backdrop: a title alone.

Documentation

Build with Krizaka

The building blocks the products are made of, documented from their source.

Props

The first screen of a page: back link, eyebrow, h1, lead, what follows them (facts, actions) and an aside.

PropTypeDéfautDescription
titlerequisReactNode—The page's title: the h1.
align"center" | "start"startcenter for a page that opens on its title alone (a hub, a contact page).
asideReactNode—Beside the text, on the right (above it on a phone): the page's bird, an illustration. Decorative or labelled by you.
back{ href: string; label: string; }—The way back to the parent page, above the eyebrow.
backdrop"none" | "grid" | "plain"gridThe brand's backdrop behind the hero (the gradient, the dome; grid adds the perspective floor).
eyebrowReactNode—A short mono line above the title (where the reader is: Open source · building block).
leadReactNode—One or two sentences under the title: what the page gives the reader.
linkAsLinkComponent—The app's link component for internal addresses (Next's Link); an <a> otherwise.
sizePageSizedefaultThe width of the content.

Accessibilité

  • Renders the page's h1 inside a header; keep one hero per page.
  • The backdrop's layers are decorative and hidden from assistive technology; the aside is yours to label or hide.
  • The back link is a plain link with its words; its arrow is decorative.

Bonnes pratiques

  • One sentence of lead: what the page gives the reader, not what it is.
  • The eyebrow says where the reader is (Open source · building block); the title says the subject.
  • Never reveal it: it is the page's largest paint. Put the bird in aside, facts or actions in the children.
  • Set --kz-hero-top once to clear a fixed navigation bar.

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