Files
sigpro-ui/components/Radial.js
natxocc d900659d88
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 3s
Migrating new components
2026-04-20 23:31:14 +02:00

18 lines
560 B
JavaScript

// components/RadialProgress.js
import { Tag } from "sigpro";
export const RadialProgress = (props) => {
const { class: className, value, max = 100, children, ...rest } = props;
const percentage = value != null ? (value / max) * 100 : 0;
const style = `--value: ${percentage}; --max: 100;`;
return Tag("div", {
...rest,
class: `radial-progress ${className || ''}`.trim(),
style: style,
role: "progressbar",
"aria-valuenow": value,
"aria-valuemin": 0,
"aria-valuemax": max
}, children || `${Math.round(percentage)}%`);
};