10 · Feedback

Aura

mode spin/dual/glow × tone (7) · width xs–lg · radius default/pill/r12 · shadow

Anel de luz que corre pela borda de qualquer elemento enquanto algo trabalha em segundo plano.

mode

mode="spin"mode="dual"mode="glow"
.heex
<div class="flex flex-wrap items-center gap-4">
  <.aura :for={m <- ~w(spin dual glow)} mode={m} tone="ai"><span class="block bg-panel px-4 py-3 text-[13.5px] whitespace-nowrap">mode="{m}"</span></.aura>
</div>

tone

accentaiinfoposwarnnegviolet
.heex
<div class="flex flex-wrap items-center gap-3">
  <.aura :for={t <- ~w(accent ai info pos warn neg violet)} tone={t}><span class="block bg-panel px-4 py-3 text-[13.5px] whitespace-nowrap">{t}</span></.aura>
</div>

width · radius · shadow

width=xswidth=smwidth=defaultwidth=lg r12 + shadow
.heex
<div class="flex flex-wrap items-center gap-4">
  <.aura :for={w <- ~w(xs sm default lg)} tone="ai" width={w}><span class="block bg-panel px-4 py-3 text-[13.5px] whitespace-nowrap">width={w}</span></.aura>
  <.aura tone="ai" width="sm" radius="pill"><.button color="neutral" variant="solid" size="md" shape="pill"><.icon name="sparkles" />Resumir com IA</.button></.aura>
  <.aura tone="accent" radius="r12" shadow><span class="block bg-panel px-4 py-3 text-[13.5px] whitespace-nowrap">r12 + shadow</span></.aura>
</div>

Uso

<.aura tone="ai"><.toast_card title="Lendo a nota" /></.aura>
<.aura tone="ai" radius="pill" width="sm"><.button>Resumir</.button></.aura>
<.aura mode="glow" tone="warn" shadow>…precisa de você…</.aura>

Regras

  • spin: uma luz gira enquanto trabalha; dual: duas cores para resultado pronto; glow: pulsa (precisa da pessoa).
  • tone: accent, ai (teal + violeta), info, pos, warn, neg, violet. Para de girar com prefers-reduced-motion.

Referência da API

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

Ring of light that runs along the border of any element while something works in the background. Styled only with Tailwind utilities; the light is a ::before cone that turns (lu-aura-spin).

<.aura tone="ai"><.toast_card title="Reading the invoice" /></.aura>
<.aura tone="ai" radius="pill" width="sm"><button>Summarize</button></.aura>
<.aura mode="glow" tone="warn" shadow>…needs you…</.aura>

mode is spin (a light turns while it works), dual (two colours, a result is ready) or glow (pulses when it needs the person). tone picks the light (ai is the assistant's teal and violet).

<.aura>

Attr Type Default Values / notes
mode :string "spin" spin, dual, glow
motion :string nil nil, spin, dual, glow - Alias of mode.
tone :string "accent" accent, ai, info, pos, warn, neg, violet
width :string "default" xs, sm, default, lg
radius :string "default" default, pill, r12
shadow :boolean false
class :any nil

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

Slots:

  • <:inner_block> (required)