Progress With Value Custom Label
spectrumui/custom-labelFreeComponent
component for the Progress With Value Custom Label
Install it
npx shadcn@latest add https://ui.spectrumhq.in/r/custom-label.jsonSource
1"use client";2import React, { useEffect, useState } from "react";3// import { ProgressWithValue } from '@/components/ui/progress-with-value';4import { ProgressWithValue } from "@/app/registry/spectrumui/progress-with-value-dependencies";56const PERCENTAGE = [0, 10, 15, 30, 45, 50, 65, 80, 90, 100];78const LABEL_DEMOS = [9 {10 title: "No Label",11 label: () => null,12 },13 {14 title: "Custom label",15 label: (value?: number | null) => (16 <span className="text-amber-400">current: {value}%</span>17 ),18 },19];2021const ProgressWithValueLabel = () => {22 const [value, setValue] = useState(20);23 useEffect(() => {24 let index = 0;25 const interval = setInterval(() => {26 setValue(PERCENTAGE[index % PERCENTAGE.length]);27 index++;28 }, 1000);29 return () => clearInterval(interval);30 }, []);3132 return (33 <div className="w-full space-y-2 px-10">34 {LABEL_DEMOS.map((demo) => (35 <div key={demo.title}>36 <div className="text-blue-500">{demo.title}</div>37 <ProgressWithValue38 value={value}39 position="follow"40 label={demo.label}41 />42 </div>43 ))}44 </div>45 );46};4748export default ProgressWithValueLabel;
What it pulls in
Other registry items
Files it writes
More from spectrumui
All 182 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | spectrumui | Components | Free | no deps | |
| Alert demoalert-1 | spectrumui | Components | Free | 1 dep | |
| Alert 2alert-2 | spectrumui | Components | Free | no deps | |
| Alert 3alert-3 | spectrumui | Components | Free | 1 dep | |
| Alert 4alert-4 | spectrumui | Components | Free | 1 dep | |
| Animated Cardanimated-card | spectrumui | Components | Free | 1 dep · 2 files | |
| Animated Draweranimated-drawer | spectrumui | Components | Free | 4 deps | |
| Animated SVG Chartanimated-SVG-chart | spectrumui | Components | Free | 1 dep |
