datui
Color scheme

Buttons

Link

Inline text link with optional icons, hover underline and visited state.

import { Link } from "datui";

Playground

<Link href="#">Read more</Link>

Examples

Accessibility

  • With href renders <a>; with only onClick renders a <button> (Enter/Space activate).
  • disabled removes href and sets aria-disabled (or native disabled on buttons) and blocks clicks.
  • before/after icons are aria-hidden.
  • target="_blank" appends visually hidden newTabLabel ("(opens in a new tab)").

API

Inline text link. Renders `<a>` with `href`, a `<button>` with only `onClick`.

PropTypeDefaultDescription
afterReactNode—Icon after the text. Decorative.
asElementType<any, keyof IntrinsicElements>—Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`.
asChildboolean—Merge link styles onto the single child element, e.g. a router link.
beforeReactNode—Icon before the text. Decorative.
classNamestring—
disabledboolean—
hasVisitedboolean—Style visited links differently.
hrefstring—
newTabLabelstring(opens in a new tab)Announced after the text when `target="_blank"`.
noUnderlineboolean—Never underline, even on hover.
relstring—
targetstring—
type"button" | "submit" | "reset"—