A design system in a box.
hip-ui.tngl.io/docs/introduction
1import * as stylex from "@stylexjs/stylex";
2import { useEffect, useState } from "react";
3
4import { ProgressCircle } from "../../components/progress-circle";
5
6const styles = stylex.create({
7 wrapper: {
8 gap: "8px",
9 display: "flex",
10 flexDirection: "column",
11 },
12});
13
14export function Basic() {
15 const [value, setValue] = useState(0);
16
17 useEffect(() => {
18 const interval = setInterval(() => {
19 setValue((prev) => {
20 const newVal = Math.min(100, prev + 10 * Math.random());
21
22 if (newVal === 100) {
23 clearInterval(interval);
24 }
25
26 return newVal;
27 });
28 }, 500);
29 }, []);
30
31 return (
32 <div {...stylex.props(styles.wrapper)}>
33 <ProgressCircle value={value} aria-label="Progress" />
34 </div>
35 );
36}