Hoppa till huvudinnehåll

LinkButton

Komponent med samma utseende och beteende som Button men avsedd att använda som länk internt eller externt i en applikation.

import { LinkButton } from '@midas-ds/components'

export const Example = () => {
return (
<div
className='card'
style={{ display: 'flex', flexDirection: 'row', gap: '1rem' }}
>
<LinkButton href='#'>Starta tjänst</LinkButton>
<LinkButton
variant='secondary'
href='#'
>
Starta tjänst
</LinkButton>
<LinkButton
variant='tertiary'
href='#'
>
Starta tjänst
</LinkButton>
</div>
)
}

Client Side Routing

Läs mer om hur du kan använda komponenten med Client Side Routing.

Riktlinjer

Se mönstret Knappar och länkar

API

NameTypeDefaultDescription
variant'primary'

Primary button is used as a positive action in a flow. Always use one primary button and never a seconday button on it's own. When using just an icon you must pass an aria-label

fullwidthfalse

Adds width: 100%; for the button to span entire width of parent

iconPlacement-

Display the icon on the left or right side of the button text

iconLucideIcon-

Add an icon from lucide-react . See Lucide.

classNamestring-
as-

Replace base component with any Client Side Routing link instead. . See Client side routing.

sizelarge

Component size (large: height 48px, medium: height 40px)