Loading & Feedback
The 10 effects F01–F10: purpose, API, options, examples, reduced motion and cost.
Experimental and not on npm
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.
Loading results…
"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.
"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
| Prop | Type | Default | Description |
|---|---|---|---|
| height | string | — | — |
| shape | "line" | "rect" | "circle" | — | — |
| width | string | — | — |
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.
Loading the example…
"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
| Prop | Type | Default | Description |
|---|---|---|---|
| label(required) | string | — | Accessible name (required). |
| max | number | — | — |
| value | number | — | Known progress; omit for an indeterminate indicator (no aria-valuenow). |
| valueText | string | — | 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.
Connecting
"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.
Loading the example…
"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
| Prop | Type | Default | Description |
|---|---|---|---|
| circle | boolean | — | — |
| label | string | — | Accessible name; omitted → decorative. It never announces (no live region). |
| show(required) | boolean | — | Draw the mark (only when the operation really succeeded). |
| size | number | 40 | px (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.
"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
| Prop | Type | Default | Description |
|---|---|---|---|
| distance | number | — | Travel in px (0–200, default 12). |
| duration | number | DurationPreset | 220 | Duration in ms or a motionDefaults.duration preset (default 220). |
| exitTo | EnterExitSide | "end" | Side the items leave towards (default "end"). |
| from | EnterExitSide | "bottom" | Side the items enter from (default "bottom"; logical start/end follow the writing direction). |
| reducedMotion | ReducedMotion | "user" | Reduced-motion policy (default "user"): reduced → opacity only. |
| selector | string | "[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.
"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
| Prop | Type | Default | Description |
|---|---|---|---|
| loading | boolean | false | Initial 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.
"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
| Prop | Type | Default | Description |
|---|---|---|---|
| onRollback | () => void | — | Called when the status becomes failed (undo the optimistic change). |
| status | OptimisticStatus | — | — |
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.
Loading the example…
"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
| Prop | Type | Default | Description |
|---|---|---|---|
| label(required) | string | — | Accessible name (required). |
| max | number | — | — |
| progress | ProgressSource | — | 0–1 source (timeline value, scroll progress…): visual per frame, aria-valuenow on integer changes. |
| size | string | 2.5em | CSS length (default 2.5em). |
| value | number | — | Known progress; omit for an indeterminate indicator (no aria-valuenow). |
| valueText | string | — | 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.
"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
| Prop | Type | Default | Description |
|---|---|---|---|
| children(required) | ReactNode | — | — |
| pending | boolean | — | — |
Also accepts the props of: React DOM attributes.