Skip to content

Button

<bh-button>

The bh-button component provides a customizable button with various sizes, variants, and styles that match the Bharat UI design system.

Basic Usage

Button

Sizes

Use the size attribute to set the button’s sizing.

SmallMediumLarge

Variants

Use the variant attribute to set the button’s semantic variant.

PrimarySecondarySuccessWarningDanger
GradientTricolor

States

Buttons can have different states like disabled, loading, etc.

NormalDisabledLoading

Button Grid

Here’s a comprehensive grid showing various button combinations:

PrimaryGradientTricolor
Primary SmallGradient SmallTricolor Small
Primary MediumGradient MediumTricolor Medium
Primary LargeGradient LargeTricolor Large

Event Handling

You can handle button clicks using the onClick property or event listeners.

Click Me

Properties

PropertyTypeDefaultDescription
variantstring”default”Button style variant (default, gradient, tricolor)
sizestring”medium”Button size (small, medium, large)
disabledbooleanfalseWhether the button is disabled
loadingbooleanfalseWhether to show a loading indicator
typestring”button”HTML button type (button, submit, reset)
onClickfunctionnullClick event handler