Skip to main content

Button

Components

Button()

Button(props, context?): ReactNode

A Button allows users to take actions when appropriate with a tap(on touch-screen devices) or click of a mouse. A Button component comes with three variants: primary, secondary (default), and text. A Button component accepts all the props that a native html button accepts plus additional customization props, such as those listed below:

Parameters

ParameterType
propsButtonProps
context?any

Returns

ReactNode

Example

 <Button variant={'primary'} label={'Primary button'} size={'sm'} onClick={onclickHandler} />

Source

libs/design-system-core/src/components/Button/index.tsx:43

Variables

BUTTON_SIZE_MAP

const BUTTON_SIZE_MAP: Record<Exclude <ButtonSize, "xs">, string>

Source

libs/design-system-core/src/components/Button/index.tsx:180


BUTTON_SIZE_PADDING_MAP

const BUTTON_SIZE_PADDING_MAP: Record<Exclude <ButtonSize, "xs">, string>

Source

libs/design-system-core/src/components/Button/index.tsx:186


BUTTON_SIZE_TEXT_MAP

const BUTTON_SIZE_TEXT_MAP: Record<Exclude <ButtonSize, "xs">, TextProps["variant"]>

Source

libs/design-system-core/src/components/Button/index.tsx:192