Anchor

Link to external websites

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:

yarn add @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:

Props

  • href

    string

    The URL to link to.

  • target

    string

    Specifies where to open the linked document.

  • rel

    string

    Specifies the relationship between the current document and the linked document.