Link
Text hyperlink for navigating between pages or triggering actions.
Basic usage
Basic usage
import { LhLink } from '@lh-ui/react'
export default function Demo() {
return (
<>
<LhLink href="/docs">Basic link</LhLink>
<LhLink href="/docs" type="primary">Primary link</LhLink>
<LhLink href="/docs" underline="always">Underline always</LhLink>
<LhLink href="/docs" disabled>Disabled link</LhLink>
</>
)
}
Link Props
| Prop | Description | Type | Values | Default |
|---|---|---|---|---|
| type | Semantic type | 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | — | 'default' |
| underline | Underline mode | 'always' | 'hover' | 'none' | — | 'hover' |
| disabled | Disabled (renders as href-less anchor, blocks click and native navigation) | boolean | — | false |
| href | Target URL (ignored when disabled) | string | — | — |
| prefixIcon | Leading icon node | ReactNode | — | — |
| suffixIcon | Trailing icon node | ReactNode | — | — |
| sx | sx layout props | SxProps | — | — |
Other native anchor attributes (target, rel, download, …) are passed through to the root <a>.
Link Events
| Event | Description | Callback | Vue equivalent |
|---|---|---|---|
| onClick | Triggered on click (blocked when disabled) | (event: MouseEvent) => void | @click |
Accessibility
The disabled state keeps role="link" and outputs aria-disabled="true": screen readers still announce "link" while marking it unavailable. The focus ring is driven by the focus-ring token.
Styles
import '@lh-ui/react/style/link'