components

Tailwind CSS Button

Browse and customize beautiful Tailwind CSS buttons in various styles and states, from active to disabled, allowing users to take actions or make choices.

Class Name
Type
Description
btnComponentBase class for the button component.
btn-softStyleSoft colored button.
btn-outlineStyleTransparent button with colored border.
btn-gradientStyleGradient button
btn-primaryColorButton with ‘primary’ color.
btn-secondaryColorButton with ‘secondary’ color.
btn-accentColorButton with ‘accent’ color.
btn-infoColorButton with ‘info’ color.
btn-successColorButton with ‘success’ color.
btn-warningColorButton with ‘warning’ color.
btn-errorColorButton with ’error’ color.
btn-activeStateForce button to show active state.
btn-disabledStateForce button to show disabled state.
btn-xsSizeButton with extra small size.
btn-smSizeButton with small size.
btn-mdSizeButton with medium(Default) size.
btn-lgSizeButton with large size.
btn-xlSizeButton with extra large size.
glassModifierButton with a glass effect.
btn-wideModifierWide button (max-w-64).
btn-blockModifierFull width button.
btn-circleModifierCircle button with a 1:1 ratio.
btn-squareModifierSquare button with a 1:1 ratio.

The standard format for button is component class btn, accompanied by modifier class btn-{semantic-color}.

Add modifier class btn-soft for soft colored buttons.

Add modifier class btn-outline for outline colored buttons.

Add modifier class btn-text for text colored buttons.

Add modifier class btn-gradient for gradient colored buttons.

Add modifier class waves for wave effect in buttons.

Use the rounded-full utility class to make buttons circular. The default shape of the button but can be altered by using TailwindCSS Border Radius utility classes.

This is the default shape of button.

Use the btn-active class to force the button to show the active state and the btn-disabled class to force the button to show the disabled state.

Use state classes with any button variants.

Add responsive class btn-{size} where {size} = xs|sm|md|lg|xl for button of different sizes.

To create a wide button, add the btn-wide class which provides additional horizontal padding.

To create a wide button, add the btn-block class which occupies the full width of the parent container.

This button will have different sizes on different browser viewpoints.

Use any icons at start/end the button.

Use btn-square or btn-circle to create circle/square button with a 1:1 ratio.

You can use btn class on <button>, <input>, <a>, etc…

Use the following sample code to build custom Social, Payment, and other types of buttons. This example also demonstrates how to create a custom button using two variables: --btn-color and --btn-fg.

Use btn-square or btn-circle to create circle/square buttons.

Use loading component to add a loader to the button.

Use class glass to create a button with glass effect.

You can achieve this style by combining the border-dashed utility class with the btn-outline modifier class.

Group a series of buttons together on a single line or stack them in a vertical/horizontal column