The hero card: the welcome or the insight at the top of a page. The text on the left (an eyebrow in mono caps with an optional icon, the title, the description, a goal meter or a list of steps, and the actions) and a landscape on the right that fades into the card.
<.hero_card eyebrow="Bem-vindo de volta" title="Metas do trimestre" description="Alinhe a equipe.">
<:actions>
<.button color="mono" size="lg"><.icon name="plus" />Novo pedido</.button>
</:actions>
</.hero_card>
<.hero_card
eyebrow="Bom dia, Alex"
title="Novembro está 12% acima de outubro"
meta="Meta de novembro"
meta_value="R$ 184 mil de R$ 250 mil"
meter={74}
animated
/>
<.hero_card
eyebrow="Configuração"
title="Falta pouco para emitir sua primeira NF-e"
picture="none"
steps={[
%{label: "Empresa", state: "done"},
%{label: "Série e numeração", state: "current"},
%{label: "Teste"}
]}
/>The picture on the right is the summit landscape (picture="summit", drawn with the --hero-*
tokens, so it follows the theme), an <img> (src), the :art slot (your own SVG) or nothing
(picture="none"). size="lg" makes the card taller; variant="panel" puts it on the panel color
instead of the soft gray and variant="ai" is the soft card with the violet eyebrow (suggestions
from the assistant). animated adds the canvas loop (mo-hero): the text rises, the landscape
breathes and the meter fills.
hero_summit/1 is the landscape on its own, for other surfaces. Give each one on the page its
own id (the gradient ids derive from it).
Summary
Functions
The landscape of hero_card/1: a thin delegate to LedgerUI.Components.Illustration.summit/1
(svg.lu-summit painted with the --hero-* tokens). Decorative: aria-hidden.
Functions
Attributes
eyebrow(:string) - The small mono caps line above the title. Defaults tonil.title(:string) (required)description(:string) - Defaults tonil.src(:string) - The picture on the right (replaces the landscape). Defaults tonil.alt(:string) - Defaults to"".position(:string) - The crop of the picture (object-position). Defaults to"center".picture(:string) - The picture when there is nosrcnor:artslot. Defaults to"summit". Must be one of"summit", or"none".size(:string) - Defaults to"md". Must be one of"md", or"lg".variant(:string) - Defaults to"soft". Must be one of"soft","panel", or"ai".heading(:string) - Defaults to"h2". Must be one of"h1","h2", or"h3".meta(:string) - The label of the goal line (needsmeta_value). Defaults tonil.meta_value(:string) - The figures of the goal line, already formatted. Defaults tonil.meter(:integer) - Goal progress, 0 to 100: draws the bar undermeta. Defaults tonil.steps(:list) - Chips of a checklist:%{label: "Empresa", state: "done" | "current" | "todo"}. Defaults to[].animated(:boolean) - The canvas loop (mo-hero). Defaults tofalse.id(:string) - Names the card (aria-labelledby) and prefixes the art. Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
actionsart- The picture as markup (an SVG), instead ofsrc.icon- An icon before the eyebrow.inner_block- Under the description: a note, a form, anything of your own.
The landscape of hero_card/1: a thin delegate to LedgerUI.Components.Illustration.summit/1
(svg.lu-summit painted with the --hero-* tokens). Decorative: aria-hidden.
Attributes
id(:string) - Prefix of the gradient ids (hs-sky...): one per summit on a page. Defaults to"hs".class(:any) - Defaults tonil.- Global attributes are accepted.