Component/Snake
An arc stretching and shrinking as it circles.
import { Snake } from "loading-dev"; export function SnakeDemo() { return <Snake size={48} />;}Size
Sets the spinner’s dimensions in pixels. The default value is 20
import { Snake } from "loading-dev"; export function SnakeSize() { return ( <div className="flex items-center gap-6"> <Snake size={16} /> <Snake size={24} /> <Snake 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 { Snake } from "loading-dev"; export function SnakeClassName() { return <Snake 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 { Snake } from "loading-dev"; export function SnakeColor() { return <Snake color="#f97316" size={32} />;}Duration
Sets the speed in ms. Higher values are slower, smaller values are faster.
import { Snake } from "loading-dev"; export function SnakeDuration() { return <Snake duration={2800} size={32} />;}State
Pauses or resumes the animation and exposes the state of the spinner.
import { Snake } from "loading-dev"; export function SnakePlayState() { return <Snake 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 { Snake } from "loading-dev"; export function SnakeEasing() { return ( <div className="flex items-center gap-6"> <Snake easing="linear" size={32} /> <Snake easing="ease-in-out" size={32} /> <Snake 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 { Snake } from "loading-dev"; export function SnakeCap() { return ( <div className="flex items-center gap-6"> <Snake cap="round" size={32} /> <Snake cap="flat" size={32} /> </div> );}