BackButton is a back-navigation link in two shapes. variant="card" (the
default) renders a GlassPanel tile with an arrow, a label and an optional
subtitle, class talos-backbtn talos-backbtn--card. variant="ghost"
renders a muted inline text link, class talos-backbtn talos-backbtn--ghost.
The arrow falls back to a text glyph (↖ on the card, ← on the ghost);
pass an icon through the arrow slot to replace it.
Card
PREVIEW
Ghost
PREVIEW
---
import BackButton from "@j_shelfwood/talos-ui/astro/BackButton.astro";
---
<BackButton href="/docs/" text="Back to docs" subtitle="Getting started" />
<BackButton variant="ghost" href="/blog" text="Back to blog">
<Icon slot="arrow" name="lucide:arrow-left" />
</BackButton>
The default slot overrides text as the label.
Props
| Prop | Type | Default | Meaning |
|---|---|---|---|
href | string | required | link target |
text | string | "Back" | label; the default slot replaces it |
subtitle | string | none | second line, card variant only |
variant | "card" | "ghost" | "card" | the GlassPanel tile or the inline text link |
class | string | none | extra classes on the link |
...rest | HTMLAttributes<"a"> | none | forwarded to the <a> |
Requires @j_shelfwood/talos-ui/talos.css; the card variant also uses the
talos-pad inset from talos-layout.css.