code/tamagui.dev/data/docs/components/anchor/2.0.0.mdx
<Highlights features={['Supports SSR.', 'Works on native and web.', 'Accepts Tamagui style props.']} />
Anchor is already installed in tamagui, or you can install it independently:
npm install @tamagui/html
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.
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.,
},
]}
/>