This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
链接
一个用于显示可点击链接的 SwiftUI Link 组件。
iOS
tvOS
Included in Expo Go
Expo UI Link 与官方 SwiftUI Link API 保持一致。


安装
Terminal
If you are installing this in an existing React Native app, make sure to install expo in your project.
用法
基本链接
BasicLinkExample.tsx
自定义标签内容
你可以将自定义组件作为 children 传入,以实现更复杂的链接标签内容。
CustomContentExample.tsx
API
import { Link } from '@expo/ui/swift-ui';
Component
Type: React.Element<LinkProps>
Displays a native link component.
Example
import { Link } from '@expo/ui/swift-ui'; import { foregroundStyle, font } from '@expo/ui/swift-ui/modifiers'; <Link label="Open" destination="https://expo.dev" modifiers={[ foregroundStyle('red'), font({ size: 24, weight: 'bold' }) ]} />