๐ŸงจPre-releaseYou shouldn't use this library-1 min read

ButtonProps API Reference

Prop reference

TitleTypeDefaultDescription
variant'primary'
| 'secondary'
| 'outlined'
| 'flat'
| 'danger'
| 'text'
primary

Variant of the button, can be 'primary', 'secondary', 'outlined', 'flat', 'danger', or 'text'

size'small'
| 'medium'
| 'large'
medium

Size of the button, can be 'small', 'medium', or 'large'

iconReactElement
โ€“

Icon to display in the button, will be cloned with size prop

iconPlacement'start'
| 'end'
start

Placement of the icon.

type'button'
| 'submit'
button

Type of the button, default is 'button', can be 'submit' for forms

disabledboolean
โ€“

Disables the button visually and functionally

fullWidthboolean
โ€“

Whether the button should take the full width of its container

onClickOnClickFunction<HTMLButtonElement>
โ€“

Click handler for the button, will be called with the click event

noWrapboolean
โ€“

Whether to nowrap the text inside the button

shimmerboolean
โ€“

Add the shimmer effect to the button

isWorkingboolean
โ€“

Set the button to its "loading" state

shortcutKeystring
โ€“

Shortcut key to trigger the button click

classNamestring
โ€“

Additional classNames for the button, will override default styles

styleCSSProperties
โ€“

Additional styles for the button

* Props marked with an asterisk are required.

CSS target reference

ExportCSS Class TargetDescription
ButtonTargetClassRoot.NPUI-Button-root

Root of the button

ButtonTargetClassSpinnerContainer.NPUI-Button-spinnerContainer

Spinner span for isWorking

ButtonTargetClassSpinnerIcon.NPUI-Button-spinnerIcon

Spinner element for isWorking

Exports are available from /src/components/button/button.tsx or from
Related APIs
Made by .