Skip to content
← Progress Bar
Edit Progress Bar
Name
Also known as (comma separated)
Brief definition
Linear progress indicator.
Notes
Tier
Core
Useful
Reference
Deleted
Controls schema (JSON array)
[ { "id": "label", "type": "text", "label": "Label", "default": "Uploading files" }, { "id": "value", "type": "number", "label": "Value (%)", "default": 62, "min": 0, "max": 100, "step": 1 }, { "id": "color", "type": "color", "label": "Colour", "default": "#A8E6C1", "presets": [ "#A8E6C1", "#BFD9F2", "#E8A020", "#F5C2E0", "#D9C8F0", "#241430" ] }, { "id": "indeterminate", "type": "toggle", "label": "Indeterminate", "default": false } ]
Templates (JSON object keyed by format)
{ "html": "<div class=\"progress-bar{{#if indeterminate}} progress-bar--indeterminate{{/if}}\">\n <div class=\"progress-bar__row\">\n <span class=\"progress-bar__label\">{{label}}</span>\n {{#unless indeterminate}}<span class=\"progress-bar__value\">{{value}}%</span>{{/unless}}\n </div>\n <div class=\"progress-bar__track\" role=\"progressbar\" aria-label=\"{{label}}\" aria-valuemin=\"0\" aria-valuemax=\"100\" {{#unless indeterminate}}aria-valuenow=\"{{value}}\"{{/unless}}>\n <div class=\"progress-bar__fill\" style=\"width:{{value}}%;background:{{color}};\"></div>\n </div>\n</div>\n<style>\n.progress-bar { width: 260px; font: 12.5px/1 system-ui, sans-serif; color: #241430; }\n.progress-bar__row { display: flex; justify-content: space-between; margin-bottom: 6px; }\n.progress-bar__value { font-weight: 700; }\n.progress-bar__track { height: 8px; border-radius: 999px; background: #24143018; overflow: hidden; }\n.progress-bar__fill { height: 100%; border-radius: 999px; }\n.progress-bar--indeterminate .progress-bar__fill { width: 40% !important; }\n@keyframes progress-bar-slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }\n@media (prefers-reduced-motion: no-preference) {\n .progress-bar__fill { transition: width .2s ease; }\n .progress-bar--indeterminate .progress-bar__fill { animation: progress-bar-slide .2s ease-in-out infinite; }\n}\n</style>", "tailwind": "<div class=\"progress-bar-tw{{#if indeterminate}} progress-bar-tw--indeterminate{{/if}} w-64 font-sans text-[12.5px] text-[#241430]\">\n <div class=\"flex justify-between mb-1.5\">\n <span>{{label}}</span>\n {{#unless indeterminate}}<span class=\"font-bold\">{{value}}%</span>{{/unless}}\n </div>\n <div role=\"progressbar\" aria-label=\"{{label}}\" aria-valuemin=\"0\" aria-valuemax=\"100\" {{#unless indeterminate}}aria-valuenow=\"{{value}}\"{{/unless}} class=\"h-2 rounded-full bg-[#24143018] overflow-hidden\">\n <div class=\"progress-bar-tw__fill h-full rounded-full motion-safe:transition-[width] motion-safe:duration-300\" style=\"width:{{value}}%;background:{{color}};\"></div>\n </div>\n</div>\n<style>\n.progress-bar-tw--indeterminate .progress-bar-tw__fill { width: 40% !important; }\n@keyframes progress-bar-tw-slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }\n@media (prefers-reduced-motion: no-preference) {\n .progress-bar-tw--indeterminate .progress-bar-tw__fill { animation: progress-bar-tw-slide .2s ease-in-out infinite; }\n}\n</style>", "react": "export function ProgressBar({\n label = \"{{label}}\",\n value = {{value}},\n color = \"{{color}}\",\n indeterminate = {{indeterminate}},\n}) {\n return (\n <div style={{ width: 260, font: \"12.5px/1 system-ui, sans-serif\", color: \"#241430\" }}>\n <div style={{ display: \"flex\", justifyContent: \"space-between\", marginBottom: 6 }}>\n <span>{label}</span>\n {!indeterminate && <span style={{ fontWeight: 700 }}>{value}%</span>}\n </div>\n <div role=\"progressbar\" aria-label={label} aria-valuemin={0} aria-valuemax={100}\n aria-valuenow={indeterminate ? undefined : value}\n style={{ height: 8, borderRadius: 999, background: \"#24143018\", overflow: \"hidden\" }}>\n <div className={indeterminate ? \"pb-fill pb-fill--indeterminate\" : \"pb-fill\"} style={{ height: \"100%\", borderRadius: 999, background: color,\n width: indeterminate ? \"40%\" : `${value}%` }} />\n </div>\n <style>{`\n @media (prefers-reduced-motion: no-preference) {\n .pb-fill { transition: width .2s ease; }\n .pb-fill--indeterminate { animation: progress-bar-react-slide 1.2s ease-in-out infinite; }\n @keyframes progress-bar-react-slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }\n }\n `}</style>\n </div>\n );\n}" }
Save
History