06 · Display
MiniCard
tone neutral/accent/success/warning/error/info
A small shortcut or entity card, clickable as a whole.
Shortcuts lifting
Emitir NF-e
Nota fiscal
Receber
Pix e boleto
Novo pedido
Balcão
.heex
<div class="grid grid-cols-3 gap-3"><.mini_card :for={{ic, t, l, d, dl} <- [{"file", "accent", "Emitir NF-e", "Nota fiscal", "0.0s"}, {"wallet", "success", "Receber", "Pix e boleto", "0.5s"}, {"cart", "info", "Novo pedido", "Balcão", "1.0s"}]} surface="card" icon={ic} tone={t} label={l} class="animate-[mo-lift_4s_ease-in-out_infinite]" style={"animation-delay:#{dl}"}><span>{d}</span></.mini_card></div>
tone (6)
neutral
Atalho
accent
Atalho
success
Atalho
warning
Atalho
error
Atalho
info
Atalho
.heex
<div class="grid grid-cols-3 gap-2.5"><.mini_card :for={t <- ~w(neutral accent success warning error info)} surface="card" icon="file" tone={t} label={t}><span>Atalho</span></.mini_card></div>
Usage
<.mini_card icon="invoice-01" title="Board packs" meta="4 relatórios" navigate={~p"/reports"} />
Rules
- The whole area is clickable; the arrow appears on hover.
API reference
Todos os function components, atributos, valores e slots que este componente cobre.
The canvas's mini card: a small card for a shortcut (an icon box over a bold label) or for a short figure (a faint label over a mono value).
<.mini_card icon="huge-invoice-01" tone="accent" label="Novo pedido" navigate={~p"/pedidos/novo"} />
<.mini_card label="A receber" value="R$ 41,2 mil" />
With href, navigate or patch the card is a link and ends in an arrow. The inner block
goes under the label. surface="card" draws it as a card (rounded 16px, a hairline and a soft
shadow) with a rounded icon avatar (a row of shortcuts) instead of the default panel. Styled only
with Tailwind utilities.
<.mini_card>
| Attr | Type | Default | Values / notes |
|---|---|---|---|
label (required) |
:string |
||
value |
:string |
nil |
A short figure: the label becomes a caption over it. |
icon |
:string |
nil |
|
tone |
:string |
"neutral" |
accent, error, info, neutral, success, warning |
surface |
:string |
"panel" |
panel, card |
class |
:any |
nil |
Any other HTML/phx attribute goes to the root element, including href, navigate, patch, method.
Slots:
<:inner_block>- Extra content under the label.