Buttons
Link
Inline text link with optional icons, hover underline and visited state.
import { Link } from "datui";Playground
<Link href="#">Read more</Link>Examples
Links
Read the guide, open the website (opens in a new tab) or . Visited style, no underline and disabled.
Accessibility
- With
hrefrenders<a>; with onlyonClickrenders a<button>(Enter/Space activate). disabledremoveshrefand setsaria-disabled(or nativedisabledon buttons) and blocks clicks.before/aftericons arearia-hidden.target="_blank"appends visually hiddennewTabLabel("(opens in a new tab)").
API
Link
Inline text link. Renders `<a>` with `href`, a `<button>` with only `onClick`.
| Prop | Type | Default | Description |
|---|---|---|---|
| after | ReactNode | — | Icon after the text. Decorative. |
| as | ElementType<any, keyof IntrinsicElements> | — | Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`. |
| asChild | boolean | — | Merge link styles onto the single child element, e.g. a router link. |
| before | ReactNode | — | Icon before the text. Decorative. |
| className | string | — | |
| disabled | boolean | — | |
| hasVisited | boolean | — | Style visited links differently. |
| href | string | — | |
| newTabLabel | string | (opens in a new tab) | Announced after the text when `target="_blank"`. |
| noUnderline | boolean | — | Never underline, even on hover. |
| rel | string | — | |
| target | string | — | |
| type | "button" | "submit" | "reset" | — |