Component

Linear Progress Bar

Animated horizontal progress bar with percentage label and gradient fill. Includes determinate (value-driven), completed (green), and indeterminate (sliding) modes. Accessible via role=progressbar with aria-valuenow/valuetext.

  • Component
  • Tailwind
  • HTML
  • MIT

Preview

Live component

Interactive preview
Open preview
9:41 100%
devsnips.dev/library/tailwind/components/progress/linear-bar/
fluid · no fixed width 100%
No dependencies Production-ready

Install

Add to your project

terminal
npx devsnips add Tailwind/Components/Progress/linear-bar
registry path: Tailwind/Components/Progress/linear-bar

Source

Implementation

code.html
<!--
Snippet Name: Linear Progress Bar
Description: Animated horizontal progress bar with percentage label and gradient fill. Includes determinate and indeterminate modes.
Author: DevSnips Contributors
Usage Example: Drop into dashboards or async task panels. Set data-value to control the fill.
-->
<div class="w-full max-w-md" data-progress="linear">
  <div class="mb-2 flex items-center justify-between">
    <span class="text-sm font-medium text-gray-700">Uploading assets…</span>
    <span class="progress-label text-sm font-semibold tabular-nums text-gray-900">0%</span>
  </div>
  <div
    class="relative h-2.5 w-full overflow-hidden rounded-full bg-gray-100"
    role="progressbar"
    aria-label="Upload progress"
    aria-valuemin="0"
    aria-valuemax="100"
    aria-valuenow="0"
    aria-valuetext="0 percent"
  >
    <div class="progress-fill absolute inset-y-0 left-0 w-0 rounded-full bg-gradient-to-r from-blue-500 to-blue-600 transition-[width] duration-300 ease-out"></div>
  </div>
</div>

<script>
  (function () {
    const root = document.currentScript.closest('[data-progress]');
    if (!root) return;
    const fill = root.querySelector('.progress-fill');
    const label = root.querySelector('.progress-label');
    const bar = root.querySelector('[role="progressbar"]');
  })();
</script>
33 lines UTF-8 · LF · Spaces: 2

AI-ready

Available to your agent.

This component is reachable through the DevSnips CLI, MCP server and Skills integrations — one registry, one resource path.

Resource path

devsnips://components/progress/linear-bar

Continue browsing

View all