Back to Tamagui

Anchor

code/tamagui.dev/data/docs/components/anchor/2.0.0.mdx

1.144.41.1 KB
Original Source

<Highlights features={['Supports SSR.', 'Works on native and web.', 'Accepts Tamagui style props.']} />

Installation

Anchor is already installed in tamagui, or you can install it independently:

bash
npm install @tamagui/html

Usage

The Anchor component provides a way to link to external websites. It extends SizableText, adding the href, target, and rel attributes.

On native, it uses React Native Linking.openURL. On web, it renders an a element with href set appropriately.

API Reference

Anchor

Inherits Tamagui props as well as:

<PropsTable data={[ { name: 'href', required: false, type: 'string', description: The URL to link to., }, { name: 'target', required: false, type: 'string', description: Specifies where to open the linked document., }, { name: 'rel', required: false, type: 'string', description: Specifies the relationship between the current document and the linked document., }, ]} />