Link

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

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

Link rendered by Tarve Link rendered by Tarve
Native render. The live version loads when this comes into view.

Import

import { Link } from "@tarve/core";

Usage

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

PropTypeDefault
href required string—
children Child—
label

Accessible label override for icon-only or otherwise non-textual links.

string—
style IntrinsicStyle—
Inherited from ViewProps 11 props
PropTypeDefault
align Style["align"]—
autoFocus

Focus this control when it first appears (HTML `autofocus`); interactive views only (Pressable).

boolean—
dismissOnOutside

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.

boolean—
dragRegion boolean—
flex

CSS `flex`: `1` is `1 1 0`; strings take any CSS value, e.g. `"1 1 176px"`.

number | string—
gap number—
justify Style["justify"]—
onOutsideClick

With `dismissOnOutside`: a press (or right click) outside the box.

() => void—
padding Style["padding"]—
portal boolean—
windowAction "minimize" | "toggleMaximize" | "toggleFullscreen" | "close"—
Inherited from PressableProps 11 props
PropTypeDefault
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

The press was held still for 500 ms (touch or mouse); its release sends no `onClick`.

() => void—
onPinch

Two fingers pinching over this node (touch screen, macOS trackpad); `scale` is cumulative, 1 at "start".

(event: import("../jsx-runtime").PinchEvent) => void—

Common props

Shared by every component. See descriptions →

classclassNamedraggabledropTargetfileDropTargethighlightidkeymotionFromonDragEndonDragEnteronDragLeaveonDragMoveonDragStartonDroponFileDragEnteronFileDragLeaveonFileDroponHighlightonPasteonPointerLeaveonPointerMoveonSizeonTransitionEndrovingGroup