v5.0 launch sale - limited time offer!
Tailwind CSS Buttons
There are 8 available components in this category, preview them all!
Primary

Secondary

Simple

With Icons
With Icons Right
Primary Contextual

Secondary Contextual

Disabled

Frequently Asked Questions
Let’s have a better look into Tailwind CSS Buttons.
How do I create a loading state for a Tailwind CSS button?
Replace or prepend the button label with a spinner element using Tailwind's animate-spin on a small SVG icon. Set the button to disabled and optionally reduce opacity to reinforce the disabled appearance. Several variants include spinner examples you can use directly.
When should I use simple or secondary buttons instead of solid ones?
Solid buttons are for the primary action, the thing you most want the user to do. Simple and secondary buttons suit secondary or tertiary actions that should be accessible but not visually competing. A typical pattern: "Save" as a solid primary button, "Cancel" as a secondary button. This hierarchy reads instantly without extra thought.
How do I make a button full-width on mobile but auto-width on desktop?
Apply w-full sm:w-auto to the button. This gives it block-level full width on the smallest breakpoint and reverts to intrinsic content width at sm and above. Pair with justify-center if using flex alignment inside the button to keep icons and text centered.
What is the correct HTML for a button that looks like a link?
Use <button> with text-style classes like text-blue-600 hover:underline instead of button styling. Keep it as a <button> if it performs an action (like "show more" or "clear filters"), and only switch to <a> if it navigates to a URL. The semantic distinction matters for screen readers and search engines.

2,000+ handcrafted snippets.
Now in your AI editor.
Build modern web apps and websites with Tailkit's huge collection of Tailwind components, templates and tools. Now available through our MCP Server.