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.
The standard format for button is component class btn
, accompanied by modifier class btn-{semantic-color}
.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Default
Primary
Secondary
Accent
Info
Success
Warning
Error
Add modifier class btn-soft
for soft colored buttons.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Default
Primary
Secondary
Accent
Info
Success
Warning
Error
Add modifier class btn-outline
for outline colored buttons.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Default
Primary
Secondary
Accent
Info
Success
Warning
Error
Add modifier class btn-text
for text colored buttons.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Default
Primary
Secondary
Accent
Info
Success
Warning
Error
Add modifier class btn-gradient
for gradient colored buttons.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Default
Primary
Secondary
Accent
Info
Success
Warning
Error
Add modifier class waves
for wave effect in buttons.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Primary
Primary
Primary
Primary
Primary
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.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
This is the default shape of button.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
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.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Add responsive class btn-{size}
where {size} = xs|sm|lg
for button of different sizes.
For medium size button, use component class `btn`.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
To create a wide button, add the btn-wide
class which provides additional horizontal padding.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
To create a wide button, add the btn-block
class which occupies the full width of the parent container.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
This button will have different sizes on different browser viewpoints by using thw following classes max-sm:btn-sm
and lg:btn-lg
.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Use any icons at start/end the button.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Primary
Primary
Primary
Primary
Primary
Primary
Primary
Primary
Use btn-square
or btn-circle
to create circle/square button with a 1:1 ratio.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
You can use btn
class on <button>
, <input>
, <a>
, etc…
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Create custom Social, Payment, and other buttons as per the following example code.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Facebook
Twitter
LinkedIn
Github
Facebook
Twitter
LinkedIn
Github
Facebook
Twitter
LinkedIn
Github
Use btn-square
or btn-circle
to create circle/square buttons.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Use loading component to add a loader to the button.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Use class glass
to create a button with glass effect.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Use class no-animation
to disable button click animation.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
I don't have click animation
Group a series of buttons together on a single line or stack them in a vertical/horizontal column
Refer the
Join
component documentation for creating a group of buttons.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">