ActionLink
A text anchor with an optional arrow and visible hover and keyboard focus.
Install
npx shadcn@latest add @jbm/action-linkNeeds the @jbm entry in components.json; see Install once.
Also installs @jbm/tokens.
Usage
import { ActionLink } from "@/jbm/ui/action-link"<ActionLink href="/ideas">Explora las ideas</ActionLink><ActionLink href="/historia" arrow={false}>Lee la historia completa</ActionLink>Props
- Stage
fluidInline-flex, sized by its text up to 100% of the container: one line is 18px × 1.4 plus 6px padding above and below (about 37px); long text wraps anywhere and adds lines.
A real <a> (all anchor attributes and the ref pass through) in Geist 18px bold with a 1px underline. On hover or keyboard focus it turns vermilion with a 2px underline; caller onMouseEnter, onMouseLeave, onFocus, and onBlur handlers still run. An optional decorative ↗ arrow follows the text.
| Prop | Type | Default | Description |
|---|---|---|---|
arrow | boolean | true | Shows the trailing ↗ arrow (aria-hidden). Set false for a plain underlined link. |
Also accepts React.ComponentPropsWithRef<"a">.
QA checks
- Hover and Tab to each link: both switch to vermilion with a thicker underline and a visible focus outline offset 5px, then revert on leave or blur.
- Check that the arrow is not read by screen readers and does not wrap onto its own line apart from the text.
- Check a long link text on a narrow screen: it wraps without overflowing.