Skip to Content
Neshel-UI
Animations (experimental)Effects

Loading & Feedback

The 10 effects F01–F10: purpose, API, options, examples, reduced motion and cost.

Experimental and not on npm

@neshel-ui/animations is a private package (0.0.0). It cannot be installed, and its API may change before a first publication. These pages document what exists in the repository.

Feedback components state what they mean to assistive technology first; motion decorates that state. Progress has a value only when you know one, skeletons stay out of the accessibility tree, and a success mark never announces by itself: your status message does, when it really succeeded. Notifications (createToaster, <Toaster>) belong to @neshel-ui/components; F06 is only generic enter and exit motion for a list another component owns.

F01 · Spinner

<Spinner> is an indeterminate role="progressbar" named by label ("Loading"). Pass decorative when text next to it already says so, as here. Under reduced motion the rotation becomes a slow pulse.

Import
@neshel-ui/animations/feedback
API
Spinner
Stylesheet
@neshel-ui/animations/feedback.css
Reduced motion
reduced — a smaller signal remains because it conveys state
Performance
The package stylesheet renders it on layers owned by the package; your element gets no transition or animation.
Preview: F01
Preview theme: F01

Loading results…

f01.tsx
"use client";
import "@neshel-ui/animations/feedback.css";
import { Spinner } from "@neshel-ui/animations/feedback";

export default function F01Example() {
  return (
    <p role="status" className="flex items-center gap-2">
      <Spinner decorative /> Loading results…
    </p>
  );
}

F02 · Skeleton shimmer

<SkeletonShimmer> is a hidden placeholder (width, height, shape), and <Shimmer> adds the sweep to an element of yours, such as the Components Skeleton. Put aria-busy="true" on the loading region.

Import
@neshel-ui/animations/feedback
API
Shimmer, SkeletonShimmer
Stylesheet
@neshel-ui/animations/feedback.css
Reduced motion
static — the decoration or content stays still
Performance
The package stylesheet renders it on layers owned by the package; your element gets no transition or animation.
Preview: F02
Preview theme: F02
f02.tsx
"use client";
import "@neshel-ui/animations/feedback.css";
import { Shimmer, SkeletonShimmer } from "@neshel-ui/animations/feedback";
import { Skeleton } from "@neshel-ui/components";

export default function F02Example() {
  return (
    <section aria-busy="true" aria-label="Loading profile" className="grid w-72 gap-3">
      <SkeletonShimmer shape="circle" />
      <SkeletonShimmer width="12rem" />
      <Shimmer>
        <Skeleton className="h-4 w-full" />
      </Shimmer>
    </section>
  );
}
Options: SkeletonShimmerProps

SkeletonShimmerProps

SkeletonShimmerProps
PropTypeDefaultDescription
heightstring——
shape"line" | "rect" | "circle"——
widthstring——

Also accepts the props of: React DOM attributes.

F03 · Progress bar

<ProgressBar> has aria-valuenow only with a real value of max; without it, it is indeterminate. label is required and valueText explains the number.

Import
@neshel-ui/animations/feedback
API
ProgressBar
Stylesheet
@neshel-ui/animations/feedback.css
Reduced motion
reduced — a smaller signal remains because it conveys state
Performance
The package stylesheet renders it on layers owned by the package; your element gets no transition or animation.
Preview: F03
Preview theme: F03

Loading the example…

f03.tsx
"use client";
import "@neshel-ui/animations/feedback.css";
import { ProgressBar } from "@neshel-ui/animations/feedback";
import { Button } from "@neshel-ui/components";
import { useState } from "react";

export default function F03Example() {
  const [value, setValue] = useState(30);
  return (
    <div className="grid max-w-sm gap-4">
      <ProgressBar label="Preparing the export" />
      <ProgressBar label="Uploading files" value={value} valueText={`${value} of 100 files`} />
      <Button variant="outline" onClick={() => setValue(Math.min(100, value + 10))}>
        More progress
      </Button>
    </div>
  );
}
Options: ProgressBarProps

ProgressBarProps

ProgressBarProps
PropTypeDefaultDescription
label(required)string—Accessible name (required).
maxnumber——
valuenumber—Known progress; omit for an indeterminate indicator (no aria-valuenow).
valueTextstring—Human-readable value (aria-valuetext).

Also accepts the props of: React DOM attributes.

F04 · Dots pulse

<DotsPulse> is an inline indeterminate indicator with the same label and decorative rules as the spinner. Under reduced motion the dots change opacity slowly instead of bouncing.

Import
@neshel-ui/animations/feedback
API
DotsPulse
Stylesheet
@neshel-ui/animations/feedback.css
Reduced motion
reduced — a smaller signal remains because it conveys state
Performance
The package stylesheet renders it on layers owned by the package; your element gets no transition or animation.
Preview: F04
Preview theme: F04

Connecting

f04.tsx
"use client";
import "@neshel-ui/animations/feedback.css";
import { DotsPulse } from "@neshel-ui/animations/feedback";

export default function F04Example() {
  return (
    <p className="flex items-center gap-2">
      Connecting <DotsPulse label="Connecting" />
    </p>
  );
}

F05 · Success mark

<SuccessMark> draws a check when show becomes true. It is decorative by default; with label it is an image with a name. It never announces anything.

Import
@neshel-ui/animations/feedback
API
SuccessMark
Stylesheet
@neshel-ui/animations/feedback.css
Reduced motion
instant — the end state appears at once
Performance
Repaints the element (colour, gradient, clip, mask, blur or stroke) while it runs; keep the area small.
Preview: F05
Preview theme: F05

Loading the example…

f05.tsx
"use client";
import "@neshel-ui/animations/feedback.css";
import { SuccessMark } from "@neshel-ui/animations/feedback";
import { Button } from "@neshel-ui/components";
import { useState } from "react";

export default function F05Example() {
  const [saved, setSaved] = useState(false);
  return (
    <div className="flex items-center gap-3">
      <SuccessMark show={saved} />
      <span role="status">{saved ? "Saved" : ""}</span>
      <Button variant="outline" onClick={() => setSaved(!saved)}>
        {saved ? "Reset" : "Save"}
      </Button>
    </div>
  );
}
Options: SuccessMarkProps

SuccessMarkProps

SuccessMarkProps
PropTypeDefaultDescription
circleboolean——
labelstring—Accessible name; omitted → decorative. It never announces (no live region).
show(required)boolean—Draw the mark (only when the operation really succeeded).
sizenumber40px (default 40).

Also accepts the props of: React DOM attributes.

F06 · Enter and exit

<EnterExit> moves the items of a list that reports data-state: they enter from from and leave towards exitTo. Here it animates a Components <Toaster motion="none">, which owns the messages, timers, focus and announcements; any list that follows the same DOM contract works.

Import
@neshel-ui/animations/feedback
API
EnterExit, createEnterExit
Stylesheet
none needed
Reduced motion
fade — opacity only, no travel
Performance
Transform and opacity, one write per frame through the shared scheduler; no layout work per frame.
Preview: F06
Preview theme: F06
    f06.tsx
    "use client";
    import { EnterExit } from "@neshel-ui/animations/feedback";
    import { Button, createToaster, Toaster } from "@neshel-ui/components";
    
    const toaster = createToaster({ max: 3 });
    
    export default function F06Example() {
      return (
        <div>
          <Button onClick={() => toaster.show({ title: "Draft saved" })}>Show a toast</Button>
          <EnterExit from="bottom" exitTo="end">
            <Toaster toaster={toaster} motion="none" label="Example notifications" hotkey="F9" />
          </EnterExit>
        </div>
      );
    }
    Options: EnterExitOptions

    EnterExitOptions

    EnterExitOptions
    PropTypeDefaultDescription
    distancenumber—Travel in px (0–200, default 12).
    durationnumber | DurationPreset220Duration in ms or a motionDefaults.duration preset (default 220).
    exitToEnterExitSide"end"Side the items leave towards (default "end").
    fromEnterExitSide"bottom"Side the items enter from (default "bottom"; logical start/end follow the writing direction).
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user"): reduced → opacity only.
    selectorstring"[data-state]"Items to animate inside the container (default "[data-state]").

    F07 · Loading button

    <LoadingButton> keeps the same button, its name, its width and its focus while loading, sets aria-disabled and blocks a second activation. Use it on a Components Button without that button's own loading prop.

    Import
    @neshel-ui/animations/feedback
    API
    LoadingButton, createLoadingButton
    Stylesheet
    @neshel-ui/animations/feedback.css
    Reduced motion
    instant — the end state appears at once
    Performance
    The package stylesheet renders it on layers owned by the package; your element gets no transition or animation.
    Preview: F07
    Preview theme: F07
    f07.tsx
    "use client";
    import "@neshel-ui/animations/feedback.css";
    import { LoadingButton } from "@neshel-ui/animations/feedback";
    import { Button } from "@neshel-ui/components";
    import { useState } from "react";
    
    export default function F07Example() {
      const [loading, setLoading] = useState(false);
      const pay = () => {
        setLoading(true);
        setTimeout(() => setLoading(false), 2000);
      };
      return (
        <LoadingButton loading={loading}>
          <Button onClick={pay}>Pay now</Button>
        </LoadingButton>
      );
    }
    Options: LoadingButtonOptions

    LoadingButtonOptions

    LoadingButtonOptions
    PropTypeDefaultDescription
    loadingbooleanfalseInitial state (default false).

    F08 · Optimistic pulse

    <OptimisticPulse> shows the status of a change made before the server answers: pending pulses, confirmed settles, failed is visibly different and calls onRollback. Pending is never presented as confirmed.

    Import
    @neshel-ui/animations/feedback
    API
    OptimisticPulse, createOptimisticPulse
    Stylesheet
    @neshel-ui/animations/feedback.css
    Reduced motion
    static — the decoration or content stays still
    Performance
    The package stylesheet renders it on layers owned by the package; your element gets no transition or animation.
    Preview: F08
    Preview theme: F08
    f08.tsx
    "use client";
    import "@neshel-ui/animations/feedback.css";
    import { OptimisticPulse, type OptimisticStatus } from "@neshel-ui/animations/feedback";
    import { Button } from "@neshel-ui/components";
    import { useState } from "react";
    
    export default function F08Example() {
      const [status, setStatus] = useState<OptimisticStatus>("idle");
      const [likes, setLikes] = useState(10);
      return (
        <div className="flex flex-wrap gap-2">
          <OptimisticPulse status={status} onRollback={() => setLikes((n) => n - 1)}>
            <Button
              variant="outline"
              onClick={() => {
                setLikes((n) => n + 1);
                setStatus("pending");
              }}
            >
              Likes: {likes}
            </Button>
          </OptimisticPulse>
          <Button variant="outline" onClick={() => setStatus("confirmed")}>
            Server confirms
          </Button>
          <Button variant="outline" onClick={() => setStatus("failed")}>
            Server fails
          </Button>
        </div>
      );
    }
    Options: OptimisticPulseOptions

    OptimisticPulseOptions

    OptimisticPulseOptions
    PropTypeDefaultDescription
    onRollback() => void—Called when the status becomes failed (undo the optimistic change).
    statusOptimisticStatus——

    F09 · Progress ring

    <ProgressRing> accepts a value, or a progress source that updates the arc every frame while aria-valuenow changes only at whole percentages. Without either it is indeterminate.

    Import
    @neshel-ui/animations/feedback
    API
    ProgressRing
    Stylesheet
    @neshel-ui/animations/feedback.css
    Reduced motion
    instant — the end state appears at once
    Performance
    Repaints the element (colour, gradient, clip, mask, blur or stroke) while it runs; keep the area small.
    Preview: F09
    Preview theme: F09

    Loading the example…

    f09.tsx
    "use client";
    import "@neshel-ui/animations/feedback.css";
    import { motionValue } from "@neshel-ui/animations/core";
    import { ProgressRing } from "@neshel-ui/animations/feedback";
    import { useMemo } from "react";
    
    export default function F09Example() {
      const progress = useMemo(() => motionValue(0.35), []);
      return (
        <div className="flex items-center gap-4">
          <ProgressRing label="Rendering" progress={progress} />
          <input
            type="range"
            aria-label="Ring progress"
            min={0}
            max={100}
            defaultValue={35}
            onInput={(event) => progress.set(Number(event.currentTarget.value) / 100)}
          />
        </div>
      );
    }
    Options: ProgressRingProps

    ProgressRingProps

    ProgressRingProps
    PropTypeDefaultDescription
    label(required)string—Accessible name (required).
    maxnumber——
    progressProgressSource—0–1 source (timeline value, scroll progress…): visual per frame, aria-valuenow on integer changes.
    sizestring2.5emCSS length (default 2.5em).
    valuenumber—Known progress; omit for an indeterminate indicator (no aria-valuenow).
    valueTextstring—Human-readable value (aria-valuetext).

    Also accepts the props of: React DOM attributes.

    F10 · Pending text

    <PendingText> passes a light band over its text while pending. There is one accessible text, forced colours show it plain, and under reduced motion it is still.

    Import
    @neshel-ui/animations/feedback
    API
    PendingText
    Stylesheet
    @neshel-ui/animations/feedback.css
    Reduced motion
    static — the decoration or content stays still
    Performance
    The package stylesheet renders it on layers owned by the package; your element gets no transition or animation.
    Preview: F10
    Preview theme: F10
    Saving your changes
    f10.tsx
    "use client";
    import "@neshel-ui/animations/feedback.css";
    import { PendingText } from "@neshel-ui/animations/feedback";
    import { Button } from "@neshel-ui/components";
    import { useState } from "react";
    
    export default function F10Example() {
      const [pending, setPending] = useState(true);
      return (
        <div className="flex items-center gap-4">
          <PendingText pending={pending}>Saving your changes</PendingText>
          <Button variant="outline" onClick={() => setPending(!pending)}>
            Toggle
          </Button>
        </div>
      );
    }
    Options: PendingTextProps

    PendingTextProps

    PendingTextProps
    PropTypeDefaultDescription
    children(required)ReactNode——
    pendingboolean——

    Also accepts the props of: React DOM attributes.

    Edit on GitHub

    On this page