UNPKG

liber-salti

Version:

Saltí - Liber Design System

53 lines (52 loc) 1.37 kB
/// <reference types="react" /> export interface ButtonProps { /** * Button label */ children?: string; /** * Variant of button style */ variant?: 'contained' | 'outlined' | 'text'; /** * The color of the button * Obs: 'destructive' and 'warning' colors are only available for 'contained' buttons */ color?: 'primary' | 'destructive' | 'warning' | 'inherit'; /** * The color of the button */ size?: 'small' | 'medium' | 'large'; /** * Icon component preceding the button text */ startIcon?: React.ReactNode; /** * Icon component after the button text */ endIcon?: React.ReactNode; /** * Action to be triggered on click */ onClick?: React.MouseEventHandler<HTMLButtonElement> & ((event: EventTarget) => void); /** * Disable button for avoiding actions on click */ disabled?: boolean; /** * Stretch the button to its parent container width */ fullWidth?: boolean; /** * Enables dark mode on the button */ darkMode?: boolean; /** * If `true` the button will show a spinner and disable click listeners */ loading?: boolean; /** * The element to be used as root node */ component?: React.ElementType; }