Skip to main content

LinkButton

import { LinkButton } from "@study/ui"

A link dressed as a button: "Study now", "All documents", "To sign-in". It navigates – Button is there for actions.

Result
Loading...
Live Editor
<div style={{ display: "flex", gap: 10, flexWrap: "wrap" }}>
  <LinkButton href="#" variant="primary" iconEnd="arrow-right">Study now</LinkButton>
  <LinkButton href="#">All documents</LinkButton>
</div>

In the app with the router:

import { Link } from "react-router";

<LinkButton as={Link} to="/faecher" variant="secondary">All courses</LinkButton>

Variants and states​

The same as for Button, without loading.

When to use​

✓ DoNavigation that is important enough for a button.
✗ Don'tA link that saves or deletes something – that is a Button.

Props​

Plus all props of the element from as (href, to, target …).

PropTypeDefaultMeaning
asElementType–The element or component that navigates, e.g. react-router's `Link`. Default `a`.
iconenum–An icon before the text.
iconEndenum–An icon after the text, e.g. an arrow for "Next".
loadingboolean–Shows a spinner instead of the icon and blocks further presses.
sizeButtonSize–sm 36 px, md 44 px (default), lg 52 px high.
tone"blau" | "petrol" | "gruen" | "gelb" | "orange" | "rot" | "violett" | "grau"–The colour of a `soft` button; default the neutral tint.
variantButtonVariant–primary – the one main action of a view (dark). secondary – everything else (outlined); the default. soft – a friendly side action on a tint, e.g. "With Claude". danger – deleting and leaving. ghost – quiet actions in toolbars and lists.
wideboolean–As wide as its place.

Accessibility​

  • Stays a link: screen readers say "link", Ctrl-click opens a new tab.
  • External links with target="_blank" get rel="noreferrer" and the icon external.