Hoppa till innehåll

Button

Terminal window
npm install @sk-web-gui/react
import { Button } from '@sk-web-gui/react';
PropTypStandardBeskrivning
loadingbooleanfalseSets loading spinner
disabledbooleanfalseSets disabled
activebooleanMakes button active
loadingTextstringSets loading text
leftIconReact.ReactElementSet the original html type of button Adds icon before button label
rightIconReact.ReactElementAdds icon after button label
color'info' | 'success' | 'primary' | 'warning' | 'error' | 'vattjom' | 'gronsta' | 'bjornstigen' | 'juniskar'primarySets color
size'sm' | 'md' | 'lg'mdSets size
variant'link' | 'primary' | 'secondary' | 'tertiary' | 'ghost'primarySets variant
childrenReact.ReactNodeReact node
roundedbooleanfalseSets rounded variant
invertedbooleanfalseSets inverted style
iconButtonbooleanfalseSets if icon button
aria-disabledReact.ButtonHTMLAttributes<HTMLButtonElement>['aria-disabled']Sets aria-disabled
showBackgroundbooleanIf the background of the button should be shown @default true
asReact.ElementType@default button
  • 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
{
"children": "Knapptext",
"color": "primary"
}
  • Template – standardstory