# Link

> A native hyperlink that opens through the platform's URI handler.

Native hyperlink primitive. Opens `href` through the platform's registered URI handler.

- Category: [Text & media](https://tarve.dev/docs.md#text-media)
- Import: `import { Link } from "@tarve/core";`
- Props type: `LinkProps`
- Source: [packages/core/src/components/link.ts:31](https://github.com/omarcosr/tarve/blob/main/packages/core/src/components/link.ts#L31)

## Usage

```tsx title="Link.tsx"
import { Link, Text, theme } from "@tarve/core";

<Link href="https://github.com/omarcosr/tarve" label="Tarve on GitHub">
  <Text color={theme.colors.primary}>Open the repository</Text>
</Link>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `href` (required) | `string` | — |  |
| `children` | `Child` | — |  |
| `label` | `string` | — | Accessible label override for icon-only or otherwise non-textual links. |
| `style` | `IntrinsicStyle` | — |  |

### Inherited from `ViewProps`

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `align` | `Style["align"]` | — |  |
| `autoFocus` | `boolean` | — | Focus this control when it first appears (HTML `autofocus`); interactive views only (Pressable). |
| `dismissOnOutside` | `boolean` | — | A press outside the box fires `onOutsideClick` instead of reaching what is under it (light dismiss). Works on portals and in-flow boxes; an open portal wins. |
| `dragRegion` | `boolean` | — |  |
| `flex` | `number \| string` | — | CSS `flex`: `1` is `1 1 0`; strings take any CSS value, e.g. `"1 1 176px"`. |
| `gap` | `number` | — |  |
| `justify` | `Style["justify"]` | — |  |
| `onOutsideClick` | `() => void` | — | With `dismissOnOutside`: a press (or right click) outside the box. |
| `padding` | `Style["padding"]` | — |  |
| `portal` | `boolean` | — |  |
| `windowAction` | `"minimize" \| "toggleMaximize" \| "toggleFullscreen" \| "close"` | — |  |

### Inherited from `PressableProps`

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `disabled` | `boolean` | — |  |
| `focusable` | `boolean` | — |  |
| `modal` | `boolean` | — |  |
| `onBlur` | `() => void` | — |  |
| `onClick` | `() => void` | — |  |
| `onContextMenu` | `(position: { x: number; y: number }) => void` | — |  |
| `onEscape` | `() => void` | — |  |
| `onHover` | `(hovered: boolean) => void` | — |  |
| `onKeyDown` | `(key: string) => void` | — |  |
| `onLongPress` | `() => void` | — | The press was held still for 500 ms (touch or mouse); its release sends no `onClick`. |
| `onPinch` | `(event: import("../jsx-runtime").PinchEvent) => void` | — | Two fingers pinching over this node (touch screen, macOS trackpad); `scale` is cumulative, 1 at "start". |

## Common props

Shared by every component (descriptions: https://tarve.dev/docs.md#common-props): `class`, `className`, `draggable`, `dropTarget`, `fileDropTarget`, `highlight`, `id`, `key`, `motionFrom`, `onDragEnd`, `onDragEnter`, `onDragLeave`, `onDragMove`, `onDragStart`, `onDrop`, `onFileDragEnter`, `onFileDragLeave`, `onFileDrop`, `onHighlight`, `onPaste`, `onPointerLeave`, `onPointerMove`, `onSize`, `onTransitionEnd`, `rovingGroup`.

Previous: [Typography](https://tarve.dev/docs/components/Typography.md) · Next: [Label](https://tarve.dev/docs/components/Label.md)

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/components/Link · Index for agents: https://tarve.dev/llms.txt
