Components · Inline Primitives
Link
StableAdded v0.0.1
Styled anchor link with variant and external support.
import { Link } from '@nexub/react';Playground
Props
variant
<Link href="#">View documentation</Link>Examples
Default
Variants
External
States
defaultvariant="default"variant="muted"variant="underlined"
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | 'default' | 'muted' | 'underlined' | 'default' | Visual style of the link. |
| external | boolean | false | Opens the link in a new tab with appropriate rel attributes. |
| href | string | — | The URL the link points to. |
| asChild | boolean | — | Merges props onto the immediate child element (Radix Slot). |
On iOS & Android: Link
@nexub/react-nativeAlpha
import { Link } from '@nexub/react-native';
<Link onPress={() => router.push('/terms')}>Terms of service</Link>Web vs mobile
Same tokens and prop names. Where the platforms differ:
| Web | iOS & Android | |
|---|---|---|
| Navigation | An anchor; works with your router via asChild. | A pressable text with onPress; navigate with your router. |
| Hit area | Visual size; xs/sm controls meet WCAG 2.5.8 (24px). | Always 44pt, extended with hitSlop when the visual is smaller. |
Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.
On device

iPhone (iOS simulator)

Pixel (Android emulator)
Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.
Link props
| Prop | Type | Default | Description |
|---|---|---|---|
| childrenrequired | string | — | — |
| href | string | — | A URL opened with Linking.openURL when the link is pressed. onPress, when given, runs instead. |
| external | boolean | false | The link leaves the app (a website, another app): adds the external-link icon and
tells screen readers it opens externally. With href, the URL opens through Linking. |
| variant | 'default' | 'muted' | 'underlined' | 'default' | default and underlined are the primary colour, muted the muted text colour.
All stay underlined, since touch screens have no hover to reveal a link. |
| style | StyleProp<ViewStyle> | — | — |
| haptic | 'selection' | 'toggleOn' | 'toggleOff' | 'confirm' | 'success' | 'reject' | 'warning' | 'snap' | — | Haptic played on press (Apple: not for plain taps — toggles, selections, outcomes). |
| stateLayer | RoleName | false | 'on-surface' | On-colour of the state layer, or false for none. |
| pressScale | number | false | 0.97 | Press-scale target, or false for none. |