---
title: "Anchor"
description: "A text link for a sentence, a footer, or a View all line. It has three colors, four underline styles, and a mark for links to other sites."
url: https://gelatinui.com/components/anchor
markdown_url: https://gelatinui.com/components/anchor.md
access: free
install: "npx shadcn@latest add @gelatin-ui/anchor"
registry_item: https://gelatinui.com/r/anchor.json
version: "2026-11-08"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Anchor

> A text link for a sentence, a footer, or a View all line. It has three colors, four underline styles, and a mark for links to other sites.

Page: https://gelatinui.com/components/anchor

## When to use it

Best for: A link that goes somewhere: in a sentence, a footer, or a card header.

- Use `underline="always"` in a sentence.
- Use `underline="hover"` where the layout already marks the link, such as a footer.
- Pass `aria-current="page"` for the page you are on.

## When not to use it

- For an action on the page, such as Retry or Undo, use a [Button](https://gelatinui.com/components/button.md).
- For the nav of a site, use a [Navigation Menu](https://gelatinui.com/components/navigation-menu.md).

## Notes for agents

- Pass `render` for a router link: `render={<Link to="/pricing" />}`.
- `external` opens a new tab with `rel="noopener noreferrer"` and adds a mark.
- A link that looks like a button uses `buttonVariants` on the `a`, not an Anchor.

## Anatomy

```text
Anchor
```

## API reference

### Anchor

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `tone` | `"destructive" \| "info" \| "neutral"` | "neutral" |  |
| `underline` | `"always" \| "dotted" \| "grow" \| "hover" \| "none"` | "always" |  |
| `variant` | `"default" \| "inherit" \| "muted"` | "default" |  |
| `external` | `boolean` | false | Opens the link in a new tab (`target="_blank"`, `rel="noopener noreferrer"`) and adds the arrow icon. A `target` or `rel` prop wins. |

Also takes every prop of Base UI `UseRender`: https://base-ui.com/react/components/use-render

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| Anchor | `anchor` | `aria-current`, `aria-disabled`, `data-icon` |  | `motion-timing`, `status-colors` |

## Usage

Pass `href` and the text.

```tsx title="release-note.tsx"
import { Anchor } from "@/components/ui/anchor";

export function ReleaseNote() {
  return (
    <p>
      The new prices start on 12 November. <Anchor href="/notes">Read the release notes</Anchor>.
    </p>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/anchor
```

It adds 6 registry items: 3 files, 1153 lines, and the npm packages `@base-ui/react`, `@phosphor-icons/react`, `tailwind-merge`, `tailwind-variants`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Button](https://gelatinui.com/components/button.md)
- [Navigation Menu](https://gelatinui.com/components/navigation-menu.md)
- [Typography](https://gelatinui.com/components/typography.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | Moves the focus to the link. |
| Enter | Follows the link. |

## Accessibility

It renders an `a`, so a screen reader says it is a link.

A link in a sentence has no 44px target: a target would cover the lines above and below.

## Motion

| Part | Motion |
| --- | --- |
| Color and line | hover · the text and the line get stronger |
| Grow | panel · `underline="grow"` draws the line from the start edge |
