---
templateEngineOverride: njk
layout: layouts/page.njk
title: Spinner
description: An indicator that can be used to show a loading state.
toc:
- label: Usage
id: usage
- label: Examples
id: examples
children:
- label: Size
id: example-size
- label: Color
id: example-color
- label: Button
id: example-button
- label: Badge
id: example-badge
- label: Input Group
id: example-input-group
- label: Empty
id: example-empty
- label: Item
id: example-item
---
{% from "macros/code_preview.njk" import code_preview %}
{% from "macros/code_block.njk" import code_block %}
{% lucide "circle-alert" %}
There is no dedicated Spinner component in Basecoat.
{% set code_default %}
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "animate-spin" } %}
Processing payment...
{% endset %}
{{ code_preview("spinner-default", code_default, class="w-full max-w-xs") }}
Spinners are pure HTML using the loader-circle Lucide icon with the animate-spin Tailwind utility. Add role="status" and aria-label="Loading" for accessibility.
Browse the examples below and copy the pattern that fits your needs.
Use the size-* utility class to change the size of the spinner.
{% set code_size %}
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "size-3 animate-spin" } %}
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "size-4 animate-spin" } %}
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "size-6 animate-spin" } %}
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "size-8 animate-spin" } %}
{% endset %}
{{ code_preview("spinner-size", code_size) }}
Use the text-* utility class to change the color of the spinner.
{% set code_color %}
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "size-6 animate-spin text-red-500" } %}
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "size-6 animate-spin text-green-500" } %}
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "size-6 animate-spin text-blue-500" } %}
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "size-6 animate-spin text-yellow-500" } %}
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "size-6 animate-spin text-purple-500" } %}
{% endset %}
{{ code_preview("spinner-color", code_color) }}
Add a spinner to a button to indicate a loading state.
{% set code_button %}
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "animate-spin" } %}
Loading...
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "animate-spin" } %}
Please wait
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "animate-spin" } %}
Processing
{% endset %}
{{ code_preview("spinner-button", code_button) }}
{% set code_badge %}
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "animate-spin" } %}
Syncing
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "animate-spin" } %}
Updating
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "animate-spin" } %}
Processing
{% endset %}
{{ code_preview("spinner-badge", code_badge) }}
Input groups can have spinners positioned inside them.
{% set code_input_group %}
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "size-4 animate-spin text-muted-foreground" } %}
Validating...
{% lucide "arrow-up" %}
{% endset %}
{{ code_preview("spinner-input-group", code_input_group, class="w-full max-w-md") }}
Use a spinner in empty states to indicate a loading or processing state.
{% set code_empty %}
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "animate-spin size-4" } %}
Processing your request
Please wait while we process your request. Do not refresh the page.
{% endset %}
{{ code_preview("spinner-empty", code_empty) }}
{% set code_item %}
{% lucide "loader-circle", { "role": "status", "aria-label": "Loading", "class": "animate-spin size-4 text-muted-foreground" } %}
Downloading...
129 MB / 1000 MB
Cancel
{% endset %}
{{ code_preview("spinner-item", code_item, class="w-full max-w-md") }}