0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

mui の CircularProgress を反時計回り(左回り/counterclockwise) に回す

Posted at

mui(v5) の CircularProgress を反時計回り(左回り / counterclockwise) に回す方法です。

variant="determinate" の場合、 value に負数を与えることで反時計回りに回すことができます。

// 時計回り
<CircularProgress variant="determinate" value={0} />
<CircularProgress variant="determinate" value={25} />
<CircularProgress variant="determinate" value={50} />
<CircularProgress variant="determinate" value={75} />
<CircularProgress variant="determinate" value={100} />

// 反時計回り
<CircularProgress variant="determinate" value={0} />
<CircularProgress variant="determinate" value={-25} />
<CircularProgress variant="determinate" value={-50} />
<CircularProgress variant="determinate" value={-75} />
<CircularProgress variant="determinate" value={-100} />

イメージ
mui-circular-progress-counterclockwise-CodeSandbox (1).png

注意
mui の ドキュメントでは 0 - 100 の正の数を受け取ると説明されており、将来的に塞がれてしまう恐れがある hacky な方法なので、実際に利用される場合にはご留意ください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?