Button
Installation
Section titled “Installation”npm install @sk-web-gui/reactAnvändning
Section titled “Användning”import { Button } from '@sk-web-gui/react';| Prop | Typ | Standard | Beskrivning |
|---|---|---|---|
loading | boolean | false | Sets loading spinner |
disabled | boolean | false | Sets disabled |
active | boolean | – | Makes button active |
loadingText | string | “ | Sets loading text |
leftIcon | React.ReactElement | – | Set the original html type of button Adds icon before button label |
rightIcon | React.ReactElement | – | Adds icon after button label |
color | 'info' | 'success' | 'primary' | 'warning' | 'error' | 'vattjom' | 'gronsta' | 'bjornstigen' | 'juniskar' | primary | Sets color |
size | 'sm' | 'md' | 'lg' | md | Sets size |
variant | 'link' | 'primary' | 'secondary' | 'tertiary' | 'ghost' | primary | Sets variant |
children | React.ReactNode | – | React node |
rounded | boolean | false | Sets rounded variant |
inverted | boolean | false | Sets inverted style |
iconButton | boolean | false | Sets if icon button |
aria-disabled | React.ButtonHTMLAttributes<HTMLButtonElement>['aria-disabled'] | – | Sets aria-disabled |
showBackground | boolean | – | If the background of the button should be shown @default true |
as | React.ElementType | – | @default button |
Enum-värden
Section titled “Enum-värden”- size:
sm,md,lg - variant:
link,primary,secondary,tertiary - type:
reset,button,submit - color:
undefined,primary,gronsta,vattjom,juniskar,bjornstigen,error,warning,success - aria-disabled:
undefined,true,false
Standardargs (från Meta.args)
Section titled “Standardargs (från Meta.args)”{ "children": "Knapptext", "color": "primary"}Storyvarianter
Section titled “Storyvarianter”- Template – standardstory
- Implementation: @sk-web-gui/button
- Storybook: Button