# LinkButton 链接按钮 **Category**: native **URL**: https://www.heroui.com/cn/docs/native/components/link-button **Source**: https://raw.githubusercontent.com/heroui-inc/heroui/refs/heads/v3/apps/docs/content/docs/cn/native/components/(buttons)/link-button.mdx > 幽灵样式按钮,无高亮按压反馈,适合行内链接式交互。 *** ## 导入 ```tsx import { LinkButton } from 'heroui-native'; ``` ## 结构 ```tsx ... ``` - **LinkButton**:根级可按压容器。内部渲染 `variant="ghost"` 的 `Button`,并强制关闭高亮反馈;使用者无法覆盖上述行为。 - **LinkButton.Label**:链接按钮文字,继承父级上下文中的尺寸与变体样式。 ## 用法 ### 基础用法 行内链接风格文字,响应按压。 ```tsx 了解更多 ``` ### 尺寸 使用 `size` 控制文字尺寸。 ```tsx ``` ### 禁用状态 禁用后不可交互。 ```tsx 已禁用的链接 ``` ### 自定义样式 在根与 `Label` 上使用 `className`。 ```tsx 样式化链接 ``` ### 与正文混排 与普通文字混排,用于条款、政策或上下文导航。 ```tsx 我同意 服务条款 隐私政策 ``` ## 示例 ```tsx import { Button, Checkbox, ControlField, LinkButton } from 'heroui-native'; import React from 'react'; import { Alert, View, Text } from 'react-native'; export default function LinkButtonExample() { const [isAgreed, setIsAgreed] = React.useState(false); const handleTermsPress = () => Alert.alert('条款', '跳转至服务条款'); const handlePrivacyPress = () => Alert.alert('隐私', '跳转至隐私政策'); return ( 我同意 服务条款 隐私政策 ); } ``` 更多示例见 [GitHub 仓库]()。 ## API 参考 ### LinkButton 继承 [Button](./button#button) 的全部属性,**除 `variant` 外**(内部固定为 `ghost`)。 **内部强制行为:** | override | value | description | | ----------- | ------------ | ---------------------------------------- | | `variant` | `ghost` | 始终为 ghost,不可修改 | | `highlight` | `false` | 高亮反馈关闭,不可修改 | | `className` | `h-auto p-0` | 移除默认按钮高度与内边距 | ### LinkButton.Label 与 [Button.Label](./button#buttonlabel) 等价,属性相同。