Navigated to /docs/ui/components/link

Link

Token-styled link primitive with disabled and underline options.

A live, theme-aware example rendered with the published component.

Import

Import the component from its dedicated entry point to keep the dependency and generated bundle explicit.

TSX
tsximport { Link } from "@tavojs/ui/link";

Normal Tavo.js applications load component styles through the Tavo.js UI plugin. If the application manages component CSS manually, also import @tavojs/ui/css/link.

When to use

Use it when

Use `Link` for anchors or anchor-like actions

Choose something else when

Avoid Link when replacing interactive controls with content-only components.

Examples

Link example

TSX
tsximport { Link } from "@tavojs/ui/link";

export function LinkExample1() {
  return (
    <>
      <Link href="/docs">Read docs</Link>
      <Link to="/docs">Read docs</Link>
    </>
  );
}

Common props and defaults

PropTypeDefaultDescription
classNamestring

Optional class hook applied to the public root element owned by the component.
hrefstring

Configures href for this component.
tostring

Configures to for this component.
replaceboolean

Configures replace for this component.
disabledboolean

Configures disabled for this component.
noUnderlineboolean

Configures noUnderline for this component.

Complete TypeScript API

Import from @tavojs/ui/link. Published exports: Link, LinkProps.

LinkProps

PropertyTypeRequiredDescription
childrenChild

No

Inherited children attribute accepted by Link.

classNamestring

No

Optional class hook applied to the public root element owned by the component.

sxSx

No

Inherited sx attribute accepted by Link.

idstring

No

Inherited id attribute accepted by Link.

rolestring

No

Inherited role attribute accepted by Link.

styleRecord<string, unknown>

No

Inherited style attribute accepted by Link.

titlestring

No

Inherited title attribute accepted by Link.

tabIndexnumber

No

Inherited tabIndex attribute accepted by Link.

hiddenboolean

No

Inherited hidden attribute accepted by Link.

disabledboolean

No

Configures disabled for this component.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by Link.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by Link.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by Link.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by Link.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by Link.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by Link.

hrefstring

No

Configures href for this component.

tostring

No

Configures to for this component.

replaceboolean

No

Configures replace for this component.

scrollboolean

No

Inherited scroll attribute accepted by Link.

noUnderlineboolean

No

Configures noUnderline for this component.

State ownership and DOM target

ConcernContract
StateNo component state contract is exposed; the application owns the rendered content and surrounding behavior.
DOM targetPublic passthrough props target the component root. Treat nested elements and private class names as implementation details.

Anatomy and related components

This component exposes one public component root rather than a compound member API.

Limitations

Avoid Link when replacing interactive controls with content-only components.

Use only the documented props, entry points, and compound members. Internal DOM nesting and CSS class names can change without becoming part of the public component contract.

Accessibility

Content components should keep meaningful text and media alternatives available to assistive technology.

  • Provide alt text for meaningful images.

  • Use semantic text variants for headings and paragraphs.

  • Do not hide essential content visually unless VisuallyHidden is intentional.

Component status

ContractCurrent value
Maturitystable
Categorycontent
Component import@tavojs/ui/link
Explicit CSS import@tavojs/ui/css/link
PreviewInteractive preview available on this page