---
url: /reference/interface/ui-components/link.md
---
# Link

链接用于展示可点击的文本，跳转到指定地址。

## 使用

::: code-group

```ts [Angular]
import { NxLink } from "@pc-nexus/angular";
```

```ts [React]
import { NxLink } from "@pc-nexus/react";
```

:::

## 属性

:::comp-props

| 名称         | 类型      | 必填 | 描述                              |
| ------------ | --------- | ---- | --------------------------------- |
| `href`       | `string`  | Y    | 链接地址，支持完整 URL 和相对路径 |
| `openNewTab` | `boolean` |      | 是否在新标签页打开，默认 `false`  |
| `disabled`   | `boolean` |      | 链接禁用                          |

:::

## 示例

### Basic

链接的默认用法，通过 `href` 指定跳转地址。

:::demo src=link-basic
:::

### Open New Tab

通过 `openNewTab` 在新标签页打开链接。

:::demo src=link-open-new-tab
:::

### Disabled

通过 `disabled` 设置链接的禁用状态。

:::demo src=link-disabled
:::
