Skip to main content

Button

The <Button/> component is a versatile UI element that can be used for various interactions within your application. Below you will find detailed information about its props and how to use it.

Props

PropTypeDefaultDescription
typeButtonType.Primary | ButtonType.Secondary | ButtonType.TertiaryButtonType.SecondaryDetermines the button style.
sizeButtonSize.Small | ButtonSize.Medium | ButtonSize.LargeButtonSize.MediumSpecifies the size of the button.
labelstringRequiredThe text to be displayed inside the button.
loadingbooleanfalseDisplays a loading indicator inside the button when set to true.
onClick() => voidnullOptional click handler function for button click events.
fullWidthbooleanfalseWhen true, the button will take the full width of its container.
startEnhancerReact.ReactNodenullOptional element to be placed at the start of the button.
endEnhancerReact.ReactNodenullOptional element to be placed at the end of the button.
disabledbooleanfalseDisables the button when set to true.

Example Usage

Primary Button

<Button
label="Primary Button"
type={ButtonType.Primary}
size={ButtonSize.Large}
onClick={() => alert('Primary Button Clicked')}
/>

Secondary Button

<Button
label="Secondary Button"
type={ButtonType.Secondary}
size={ButtonSize.Medium}
onClick={() => alert('Secondary Button Clicked')}
/>

Tertiary Button

<Button
label="Tertiary Button"
type={ButtonType.Tertiary}
size={ButtonSize.Small}
onClick={() => alert('Tertiary Button Clicked')}
/>