06 · Display

HeroCard

eyebrow · title · description · <:actions> · art on the right fading out · size md/lg · variant soft/panel · <:icon> · <:inner_block>

The welcome or highlight card at the top of the page: text on the left (eyebrow, title, description and actions) and a landscape on the right that fades into the card background.

The greeting enters, the landscape breathes and the goal fills up

Bom dia, Alex

Novembro está 12% acima de outubro

Faltam 10 dias para fechar o mês. Três pedidos esperam aprovação.

Meta de novembro R$ 184 mil de R$ 250 mil
.heex
<.hero_card
  id="hero-loop"
  animated
  eyebrow="Bom dia, Alex"
  title="Novembro está 12% acima de outubro"
  description="Faltam 10 dias para fechar o mês. Três pedidos esperam aprovação."
  meta="Meta de novembro"
  meta_value="R$ 184 mil de R$ 250 mil"
  meter={74}
>
  <:actions>
    <.button color="mono" size="lg"><.icon name="plus" />Novo pedido</.button>
    <.button variant="outline" size="lg"><.icon name="arrow-up-right" />Ver relatório</.button>
  </:actions>
</.hero_card>

size

size="md"
Painel

Pedidos de hoje

48 pedidos, 6 aguardando separação.

size="lg"
Bem-vindo de volta

Metas do trimestre

Alinhe a equipe e acompanhe o que importa em um só lugar.

.heex
<div class="flex flex-col gap-2">
  <span class="font-mono text-xs text-muted">size="md"</span>
  <.hero_card
    id="hero-md"
    eyebrow="Painel"
    title="Pedidos de hoje"
    description="48 pedidos, 6 aguardando separação."
  >
    <:actions>
      <.button color="mono">Abrir pedidos</.button>
    </:actions>
  </.hero_card>
  <span class="font-mono text-xs text-muted">size="lg"</span>
  <.hero_card
    id="hero-lg"
    size="lg"
    eyebrow="Bem-vindo de volta"
    title="Metas do trimestre"
    description="Alinhe a equipe e acompanhe o que importa em um só lugar."
  >
    <:actions>
      <.button color="mono" size="lg"><.icon name="plus" />Novo pedido</.button>
      <.button variant="outline" size="lg"><.icon name="arrow-up-right" />Ver relatório</.button>
    </:actions>
  </.hero_card>
</div>

variant

variant="soft"
Financeiro

R$ 42 mil a receber esta semana

Doze faturas vencem até sexta.

variant="panel"
Financeiro

R$ 42 mil a receber esta semana

Doze faturas vencem até sexta.

.heex
<div class="flex flex-col gap-2">
  <span class="font-mono text-xs text-muted">variant="soft"</span>
  <.hero_card
    id="hero-soft"
    eyebrow="Financeiro"
    title="R$ 42 mil a receber esta semana"
    description="Doze faturas vencem até sexta."
  >
    <:actions>
      <.button variant="outline">Ver faturas</.button>
    </:actions>
  </.hero_card>
  <span class="font-mono text-xs text-muted">variant="panel"</span>
  <.hero_card
    id="hero-panel"
    variant="panel"
    eyebrow="Financeiro"
    title="R$ 42 mil a receber esta semana"
    description="Doze faturas vencem até sexta."
  >
    <:actions>
      <.button variant="outline">Ver faturas</.button>
    </:actions>
  </.hero_card>
</div>

<:icon> · <:inner_block> · no art

Sugestão da IA

Revise 3 pedidos com risco de atraso

O fornecedor de café avisou atraso de 2 dias.

Configuração

Falta pouco para emitir sua primeira NF-e

EmpresaCertificadoSérie e numeraçãoTeste
.heex
<div class="flex flex-col gap-3.5">
  <.hero_card
    id="hero-ai"
    variant="ai"
    eyebrow="Sugestão da IA"
    title="Revise 3 pedidos com risco de atraso"
    description="O fornecedor de café avisou atraso de 2 dias."
  >
    <:icon><.icon name="ai" size="sm" /></:icon>
    <:actions>
      <.button color="primary"><.icon name="ai" />Revisar agora</.button>
      <.button variant="ghost">Depois</.button>
    </:actions>
  </.hero_card>
  <.hero_card
    id="hero-nfe"
    eyebrow="Configuração"
    title="Falta pouco para emitir sua primeira NF-e"
    picture="none"
    steps={[
      %{label: "Empresa", state: "done"},
      %{label: "Certificado", state: "done"},
      %{label: "Série e numeração", state: "current"},
      %{label: "Teste"}
    ]}
  >
    <:actions>
      <.button color="mono">Continuar</.button>
    </:actions>
  </.hero_card>
</div>

Usage

<.hero_card eyebrow="Bom dia, Alex" title="Novembro está 12% acima de outubro"
  description="Faltam 10 dias para fechar o mês.">
  <:actions>
    <.button color="mono" size="lg" icon="huge-add-01">Novo pedido</.button>
    <.button variant="outline" size="lg">Ver relatório</.button>
  </:actions>
  <:art><.summit /></:art>
</.hero_card>

<.hero_card eyebrow="Sugestão da IA" title="Revise 3 pedidos" variant="panel">
  <:icon><.icon name="huge-ai-magic" /></:icon>
  <.progress_bar value={74} />
</.hero_card>

Rules

  • One per page, at the top.
  • The art (src or <:art>) takes the right side and fades into the card background; without it, the text uses the full width.
  • size="lg" for the home page; md on the others. variant="panel" when the page background is already gray.
  • Motion: the text enters from below, the landscape layers move slowly and the goal fills up; loops in both themes.

API reference

Todos os function components, atributos, valores e slots que este componente cobre.

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 --lu-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: the text rises, the landscape breathes and the meter fills (lu-hero-* keyframes). Styled only with Tailwind utilities.

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

<.hero_card>

Attr Type Default Values / notes
eyebrow :string nil The small mono caps line above the title.
title (required) :string
description :string nil
src :string nil The picture on the right (replaces the landscape).
alt :string ""
position :string "center" The crop of the picture (object-position).
picture :string "summit" summit, none - The picture when there is no src nor :art slot.
size :string "md" md, lg
variant :string "soft" soft, panel, ai
heading :string "h2" h1, h2, h3
meta :string nil The label of the goal line (needs meta_value).
meta_value :string nil The figures of the goal line, already formatted.
meter :integer nil Goal progress, 0 to 100: draws the bar under meta.
steps :list [] Chips of a checklist: %{label: "Empresa", state: "done" \| "current" \| "todo"}.
animated :boolean false The canvas loop (mo-hero).
id :string nil Names the card (aria-labelledby) and prefixes the art.
class :any nil

Any other HTML/phx attribute goes to the root element.

Slots:

  • <:actions>
  • <:art> - The picture as markup (an SVG), instead of src.
  • <:icon> - An icon before the eyebrow.
  • <:inner_block> - Under the description: a note, a form, anything of your own.

<.hero_summit>

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.

Attr Type Default Values / notes
id :string "hs" Prefix of the gradient ids (hs-sky...): one per summit on a page.
class :any nil

Any other HTML/phx attribute goes to the root element.