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
activeboolean–Makes button active
loadingTextstring“Sets loading text
leftIconReact.ReactElement–Set the original html type of button Adds icon before button label
rightIconReact.ReactElement–Adds 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.ReactNode–React node
roundedbooleanfalseSets rounded variant
invertedbooleanfalseSets inverted style
iconButtonbooleanfalseSets if icon button
aria-disabledReact.ButtonHTMLAttributes<HTMLButtonElement>['aria-disabled']–Sets aria-disabled
showBackgroundboolean–If 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