mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-28 07:09:50 +00:00
Migrated 93 MDX pages from old Tamagui-based site to @hanzo/docs system: - 13 intro pages (installation, props, styles, themes, etc.) - 22 core pages (configuration, styled, variants, animations, etc.) - 48 component pages (button, dialog, select, toast, etc.) - 14 guide pages (next-js, expo, vite, webpack, metro, etc.) Zero tamagui references. Uses @hanzo/docs-base-ui + @hanzo/docs-mdx.
54 lines
1.2 KiB
Plaintext
54 lines
1.2 KiB
Plaintext
---
|
|
title: Anchor
|
|
description: Link to external websites
|
|
name: anchor
|
|
component: Anchor
|
|
package: html
|
|
---
|
|
|
|
- Supports SSR.
|
|
- Works on native and web.
|
|
- Accepts Hanzo GUI style props.
|
|
## Installation
|
|
|
|
Anchor is already installed in `@hanzo/gui`, or you can install it independently:
|
|
|
|
```bash
|
|
npm install @hanzogui/html
|
|
```
|
|
|
|
## Usage
|
|
|
|
The Anchor component provides a way to link to external websites. It extends [SizableText](/docs/components/text#sizable-text), 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 [Gui props](/docs/intro/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.`,
|
|
},
|
|
]}
|
|
/>
|