CxJS

LinkButton

import { LinkButton } from 'cx/widgets'; Copied

Link buttons look like buttons and behave like Links. LinkButton inherits Button options such as confirm, icon or disabled state.

<div className="flex flex-wrap items-start gap-2">
  <LinkButton mod="primary" href="~/docs/intro/installation">
    Installation
  </LinkButton>
  <LinkButton mod="danger" href="~/docs/intro/breaking-changes">
    Breaking Changes
  </LinkButton>
  <LinkButton mod="hollow" href="~/docs/forms/text-field">
    TextField
  </LinkButton>
  <LinkButton disabled href="~/docs/intro/what-is-cxjs">
    Disabled
  </LinkButton>
</div>

Configuration

PropertyTypeDescription
hrefstringURL to the link’s target location. Use ~/ or #/ prefix for pushState/hash based navigation. Use +/ prefix for URLs relative to the parent route.
urlstringBinding to the current URL location in the store. If href matches url, the active CSS class is applied.
matchstringDetermines how href is matched against url to detect active state. Supported values are equal (default), prefix, and subroute.
disabledbooleanSet to true to disable the link button.
targetstringSpecifies where to open the linked document (e.g., _blank).
confirmstringConfirmation message to show before navigation. Inherited from Button.
iconstringIcon to display inside the button. Inherited from Button.
modstringVisual modifier. Common values: primary, danger, hollow.
activeClassstring | objectAdditional CSS class applied when the link is active.
activeStylestring | objectAdditional CSS style applied when the link is active.
inactiveClassstring | objectAdditional CSS class applied when the link is not active.
inactiveStylestring | objectAdditional CSS style applied when the link is not active.