Knapp

NPM-pakke

Navn:nav-frontend-knapper
Siste versjon:2.0.24
Peer dependencies:classnames nav-frontend-js-utils nav-frontend-knapper-style prop-types react

Installering

npm install nav-frontend-knapper classnames nav-frontend-js-utils lodash.throttle prop-types react nav-frontend-knapper-style nav-frontend-core nav-frontend-typografi-style --save

Kopiert!


yarn add nav-frontend-knapper classnames nav-frontend-js-utils lodash.throttle prop-types react nav-frontend-knapper-style nav-frontend-core nav-frontend-typografi-style

Kopiert!

Moduler

Import

import KnappBase from 'nav-frontend-knapper';

Kopiert!

React props

PropertyTypeDefaultRequiredDescription
autoDisableVedSpinner
boolean
-
-
autoFocus
boolean
-
-
disabled
boolean
-
-
form
string
-
-
formAction
string
-
-
formEncType
string
-
-
formMethod
string
-
-
formNoValidate
boolean
-
-
formTarget
string
-
-
htmlType
"submit" | "button" | "reset"
-
Verdi for <button/>-attributtet 'type', angir knappens default funksjon
inaktivKlasseVedDisabled
boolean
-
-
kompakt
boolean
-
Innstillinger for å endre på knappens form.
mini
boolean
-
Tettere, 32px høy variant
name
string
-
-
onClick
(event: MouseEvent<HTMLButtonElement, MouseEvent>) => void
-
-
spinner
boolean
-
Knapp med spinner
type
"standard" | "hoved" | "fare" | "flat"
-
Varianter å velge mellom
value
string | number | string[]
-
-