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
Props
Plus all props of the element from as (href, to, target …).
| Prop | Type | Default | Meaning |
|---|---|---|---|
as | ElementType | – | The element or component that navigates, e.g. react-router's `Link`. Default `a`. |
icon | enum | – | An icon before the text. |
iconEnd | enum | – | An icon after the text, e.g. an arrow for "Next". |
loading | boolean | – | Shows a spinner instead of the icon and blocks further presses. |
size | ButtonSize | – | 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. |
variant | ButtonVariant | – | 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. |
wide | boolean | – | As wide as its place. |
Accessibility
- Stays a link: screen readers say "link", Ctrl-click opens a new tab.
- External links with
target="_blank"getrel="noreferrer"and the iconexternal.