Skip to content

Component/Loop

A dash running along a figure-eight.

Speed1600ms
Opacity100%
import { Loop } from "loading-dev"; export function LoopDemo() {  return <Loop size={48} />;}

Size

Sets the spinner’s dimensions in pixels. The default value is 20

import { Loop } from "loading-dev"; export function LoopSize() {  return (    <div className="flex items-center gap-6">      <Loop size={16} />      <Loop size={24} />      <Loop size={40} />    </div>  );}

Custom Classes

You can use a custom className in case you need to tweak the spinner in a specific way that the library doesn’t provide.

import { Loop } from "loading-dev"; export function LoopClassName() {  return <Loop className="opacity-40" size={32} />;}

Color

The loader inherits currentColor from the parent by default. You can tint it in any way you want. It accepts any valid CSS color.

import { Loop } from "loading-dev"; export function LoopColor() {  return <Loop color="#f97316" size={32} />;}

Duration

Sets the speed in ms. Higher values are slower, smaller values are faster.

import { Loop } from "loading-dev"; export function LoopDuration() {  return <Loop duration={3200} size={32} />;}

State

Pauses or resumes the animation and exposes the state of the spinner.

import { Loop } from "loading-dev"; export function LoopPlayState() {  return <Loop playState="paused" size={32} />;}

Easing

Controls how the spinner rotates. linear moves at a constant speed, ease-in-out starts slowly, speeds up, then slows down.stacked combines the two so it changes speed without stopping. The default easing is linear.

import { Loop } from "loading-dev"; export function LoopEasing() {  return (    <div className="flex items-center gap-6">      <Loop easing="linear" size={32} />      <Loop easing="ease-in-out" size={32} />      <Loop easing="stacked" size={32} />    </div>  );}

Cap

Controls how the ends of the stroke are drawn. round finishes them with a half circle, flat cuts them square. The default cap is round.

import { Loop } from "loading-dev"; export function LoopCap() {  return (    <div className="flex items-center gap-6">      <Loop cap="round" size={32} />      <Loop cap="flat" size={32} />    </div>  );}