Dashed Spinner

A tailwind loading spinner with a dashed ring and smooth rotation.

Loading…
Tailwind CSS
<div class="flex items-center gap-3">
  <div class="w-10 h-10 rounded-full border-4 border-dashed border-indigo-500 animate-spin" role="status" aria-label="Loading"></div>
  <span class="text-sm font-medium text-slate-500 dark:text-slate-400">Loading…</span>
</div>

Free to use in personal and commercial projects. No attribution required.

Variants

Same component, different looks. Preview each one live and copy the code you like.

Emerald

Matches green themed loaders on success flows and eco brands.

Loading…
Tailwind CSS

Large

Bigger ring with a specific message for full page transitions.

Loading your dashboard…
Tailwind CSS

Dotted

A dotted ring reads softer and more playful than the dashed version.

Loading…
Tailwind CSS

About this dashed spinner

This tailwind loading spinner uses a dashed ring instead of a solid arc, giving a lighter and more playful loading indicator. The dashed segments blur slightly as it spins, which reads as motion even at small sizes. It suits friendly consumer products where the standard solid spinner feels too corporate.

The dashed spinner css is just three utilities: border-dashed for the segmented ring, rounded-full to close the circle, and animate-spin for the rotation. A 4px border keeps the dashes chunky enough to read at small sizes, and pairing it with a short Loading label follows the common pattern for inline loaders.

Size it with width and height utilities and recolor the border to match the surrounding context. Slow the rotation with an arbitrary animation-duration when the default spin feels frantic, and always add role=status or an aria-label so the loading state is announced.

Indeterminate waits need a motion signal, because static text that says Loading feels frozen. Without visible movement, visitors assume the page stalled and click again, which is how duplicate submissions happen. A spinner's continuous rotation tells the brain that work is in progress, which buys patience. Circular motion specifically reads as an ongoing process, which is why the ring beat every other loader shape.

The ring is just a border: border-dashed turns it into segments, rounded-full closes the circle, and animate-spin rotates the whole element. The dashes are the clever part, since the gaps between segments make the rotation visible even at small sizes where a solid arc would blur. A 4px border keeps each dash chunky enough to read. Only the shape spins; there are no extra elements and no custom keyframes.

Recolor the border to match its context: white dashes on a dark button, brand color on a light card. Slow the spin to 2 seconds with an arbitrary animation-duration when the default feels frantic on calm pages. For waits that might stretch past a few seconds, pair the spinner with a short status word so visitors know what is happening. Keep one spinner style across the whole product so motion feels consistent.

The mistake is a spinner with no text and no timeout: users stare at rotation with no idea what is loading or whether it stalled. After ten seconds of spinning, that is indistinguishable from a frozen page. Always pair the spinner with a status label, and after thirty seconds offer a retry or an escape. A spinner is a promise that something is happening; promises need either fulfillment or an honest update.

Where to use it

  • ✓ Button loading states
  • ✓ Card content loading
  • ✓ Image placeholders
  • ✓ Form submission feedback

Customization tips

Use [animation-duration:0.6s] to speed it up or 2s to calm it down. Try border-t-indigo-500 border-dashed for a two-tone ring. Thicker borders (border-8) suit large empty states.

Design notes

When to use

The dashed spinner fits short, light waits where a heavy solid spinner would feel overdramatic: inline button states, small empty states, and card-level refreshes. The broken ring reads as motion even at small sizes, and the playful feel suits friendly products. Pair it with a short status word when the wait might stretch.

What to avoid

Do not use it for long operations without any progress information, because an endless playful spin starts to feel mocking after thirty seconds. Avoid very small sizes where the dashes blur into a solid ring and lose the effect. And do not use spinners as decoration on static pages, since motion implies something is happening.

Accessibility

Always pair the spinner with visible text like Loading, and expose it with role status so screen readers announce it once. Honor prefers-reduced-motion by showing a static indicator with the text instead of the spin.

Frequently asked questions

How do I make a dashed spinner in Tailwind?

Apply border-4 border-dashed rounded-full to a square div and add animate-spin. The dashed border segments create the rotating dashed-ring effect with no custom CSS.

How do I change the speed of this animated circle loader tailwind spinner?

Override the duration with an arbitrary value like [animation-duration:0.6s] for faster or [animation-duration:2s] for slower. The default animate-spin is 1 second per revolution.

When should I use a dashed spinner instead of a solid one?

It is purely aesthetic. Dashed reads lighter and friendlier, solid reads more standard and corporate. Pick one style and use it consistently across your product.

How do I make a dashed spinner with a single div using repeating-conic-gradient?

Set the background to repeating-conic-gradient(from 0deg, currentColor 0 12deg, transparent 12deg 24deg) on a rounded-full div, then hollow the center with a radial mask or an inner background-colored circle. Animate it with a simple rotate keyframe. You get a dashed ring loader with zero SVG and one element.

How do I center a loading spinner inside a button?

Make the button a flex container with items-center and justify-center, and give the spinner a fixed width and height so the layout does not shift. If the button swaps text for a spinner during loading, set a min-width on the button so it does not shrink. Keeping the size stable avoids layout jank on every submit.

What size should a page-level spinner be compared to an inline one?

Page-level spinners work well at 48 to 64 pixels, centered in the viewport with a label like "Loading" for context. Inline spinners should match the surrounding text at 16 to 20 pixels so they sit naturally in a line. Scale the stroke or dash width with the size so small spinners do not look chunky.

Customize it with our tools