# BackButton

Small ghost capsule with a leading chevron — the standard 'go back' affordance for nested pages. Defaults to `window.history.back()`; pass `onClick` to plug in router-aware navigation. The chevron rotates automatically under RTL.

[View examples](https://marsam.rahhal.app/components/back-button) · [Agent index](https://marsam.rahhal.app/llms.txt)

**Import:** `@rahhal/ui/back-button`

**Category:** `actions`

## Behavior

- Default click handler: `window.history.back()` — works without a router.
- Override with `onClick` for router-aware navigation, e.g. `useNavigate()(-1)` (react-router) or `router.back()` (next/navigation).
- The chevron auto-flips under RTL via `rtl:rotate-180`; layout uses logical Tailwind utilities.

## Props

| prop | type | purpose |
| --- | --- | --- |
| label | ReactNode | label rendered next to the chevron · default "Back" |
| onClick | (e) => void | override default history.back() behavior |
| variant | Button variant | default "ghost" · "outline" for busy backgrounds |
| size | Button size | default "sm" |
