Link

The Link component provides a way to create tappable controls that navigate to a specified URL. This component can be used to open web pages, app-specific URLs, or other schemes.

Note: If the Link component is used within a widget, the widgetURL modifier will be ignored.

Props

Name Type Description
url string The destination URL to open when tapped.
children string | VirtualNode The content displayed inside the link. Can be plain text or a custom layout.

Example

1<Link url={Script.createOpenURLScheme('Script A')}>
2  Open Script A
3</Link>
4
5<Link url="https://example.com">
6  <HStack>
7    <Image
8      systemName="globe"
9      width={20}
10      height={20}
11      padding={{ trailing: 8 }}
12    />
13    <Text>Open Link</Text>
14  </HStack>
15</Link>

This component supports both simple text and complex layouts as its children. When tapped, it opens the provided url using the appropriate handler (e.g., Safari, another app, or a custom scheme).