Intro
Sjekk ut denne artikkelen om hvordan vi lager universelt utformet lenker.
Egnet til:
- Lenke til nye sider
- Innholds-snarveier
Eksempler
Props
Link
- as? React.ElementType
- OverridableComponent-api
- underline?boolean
- Inverts when the underline appears. If this is false, the underline does not appear by default, but does appear when the link is hovered. This makes it more suitable for use when inlined in text.
- inlineText?boolean
- Renders link with `display: inline` for better wrapping in text.
- variant?"action" | "neutral" | "subtle"
- Variant of the component to use.
- children ReactNode
- Link text
- className? string
- ref? Ref<HTMLAnchorElement>
- Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom
- Link extends HTMLAnchorElement
Tokens
Token | Fallback |
---|---|
--ac-link-text | --a-text-action |
--ac-link-focus-text | --a-text-on-action |
--ac-link-focus-bg | --a-border-focus |
--ac-link-focus-border | --a-border-focus |
--ac-link-active-text | --a-text-on-action |
--ac-link-active-bg | --a-border-focus |
--ac-link-active-border | --a-border-focus |
--ac-link-action-text | --a-text-action |
--ac-link-neutral-text | --a-text-default |
--ac-link-subtle-text | --a-text-subtle |