Skip to content

Indeterminate progress bar in HTML and CSS

A thin bar where a segment slides continuously, for a load of unknown duration.

Here is an excerpt of this component's code in HTML and CSS. The full code is free for members, ready to copy into your project.

This component also comes in

Open in a new tab

The code in HTML and CSS

index.html
<!doctype html>
<html lang="fr">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Barre de progression indéterminée</title>
    <link rel="stylesheet" href="style.css" />
  </head>
  <body>
    <main class="demo">
      <div class="bar" role="status">
        <span>Import du fichier en cours</span>
style.css
:root {
  --bar-track: #ccfbf1;
  --bar-fill: #0f766e;
  --bar-text: #042f2e;
  --demo-bg: #f0fdfa;
  --demo-text: #042f2e;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bar-track: #134e4a;
    --bar-fill: #5eead4;

Free component: copy it freely, including for commercial projects.

Loaders components in HTML and CSS
  • Three dots bouncing one after another, for a short wait or a message being typed.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A button's state while a form is submitting: a small spinner and a "Sending" label.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A spinning ring with a colored segment, alongside a loading text.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component