Migrating new components
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 3s
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 3s
This commit is contained in:
18
components/Radial.js
Normal file
18
components/Radial.js
Normal file
@@ -0,0 +1,18 @@
|
||||
// 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)}%`);
|
||||
};
|
||||
Reference in New Issue
Block a user