DNA loaders

DNA-themed decorative loader family with five variants (HelixLoader, LadderLoader, TwistLoader, CoilLoader, WeaveLoader) built on framer-motion. Each variant uses a token color class and a size prop (sm, md, lg, xl) that scales its box.

componentstyledloadersregistry-item.json
DNA loaders
LIVE · running in a sandboxed iframe
Installed with shadcn add · 2 workarounds · theme from registry.json
  • applied the registry's theme (tokens, fonts and CSS from the registry preview settings)
  • installed base item https://ai2.design/r/tokens.json (registry preview settings)
See how it was built

Installation

pnpm dlx shadcn@latest add @ai2/loaders-dna

Requires @ai2 in the registries of your components.json (shadcn adds official directory namespaces automatically).

Usage

usage.tsx
import { HelixLoader } from "@/components/ui/loaders-dna"export function Example() {  return <HelixLoader size="lg" label="Analyzing sequence" />}
  • Show an inline busy indicator next to a button, label or table row while an async action runs.
  • Use a decorative, on-brand loading state for a science, bio, data or technical product surface.
  • Pick a variant by mood: Helix or Weave for complex processing, Twist for a compact spinner-like state, Coil or Ladder for progress-like feedback.
  • Choose a size (sm to xl) to match the surrounding typography or the base spinner box scale.

Examples

Inline loading in a button

Shows a small Twist loader inside a pending submit button.

inline-loading-in-a-button.tsx
import { TwistLoader } from "@/components/ui/loaders-dna"export function SubmitButton({ pending }: { pending: boolean }) {  return (    <button type="submit" disabled={pending} className="inline-flex items-center gap-2">      {pending ? <TwistLoader size="sm" label="Saving" /> : null}      Save    </button>  )}

Full-panel processing state

Centers a Helix loader with a status message while data is fetched.

full-panel-processing-state.tsx
import { HelixLoader } from "@/components/ui/loaders-dna"export function ProcessingPanel() {  return (    <div className="flex flex-col items-center gap-3 py-12">      <HelixLoader size="xl" label="Processing genome data" />      <p className="text-sm text-muted-foreground">This can take a minute.</p>    </div>  )}

Choosing a variant per context

Renders a Coil loader in a table row and a Weave loader in a card header.

choosing-a-variant-per-context.tsx
import { CoilLoader, WeaveLoader } from "@/components/ui/loaders-dna"export function StatusRow() {  return (    <div className="flex items-center gap-4">      <CoilLoader size="sm" label="Syncing" />      <WeaveLoader size="md" label="Indexing" className="text-foreground" />    </div>  )}

API reference

PropTypeDefaultDescription
size"sm" | "md" | "lg" | "xl""md"Box scale of the loader: sm = size-4, md = size-5, lg = size-6, xl = size-8. Applies to all five variants. Exported as the StyledSize type.
labelstring"Loading"Accessible name, set as aria-label on the role="status" container.
classNamestring—Additional Tailwind classes merged with the variant's base classes via cn(). Use it to override color (for example text-foreground) or spacing.
...propsReact.ComponentProps<"div">—All other standard div attributes are forwarded to the root element. They are spread after the defaults, so they can override data-slot, role or aria-label.

Accessibility

  • Each loader renders a container with role="status" and an aria-label (default "Loading"). Set label to a specific message such as "Saving changes" so screen reader users know what is in progress.
  • The animated dots and bars are purely decorative spans with no text content, so no extra hidden text is needed beyond the label.
  • Reduced motion is NOT honored: the source explicitly keeps the animation running under prefers-reduced-motion. WeaveLoader calls useReducedMotion, but both branches of its ternary return the same keyframes, so it has no effect. If your audience needs reduced motion, wrap the component yourself and swap in a static indicator, or fork the file.
  • Color comes from text tokens (text-primary, text-info, text-brand, text-success, text-warning) through bg-current, so contrast depends on the token palette and the parent background. Verify contrast on your surface.
  • Because the loader is decorative and looping, avoid placing many instances on one screen in a way that causes visual noise, and keep it visible long enough to be perceived.

Docs written by anthropic:claude-haiku-5-5 from the registry source.

Use with Coding Agent

Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.

prompt.md
Use the "DNA loaders" component (ai2/loaders-dna) from its shadcn registry.1. Install it with: npx shadcn@latest add @ai2/loaders-dna2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: size, label, className, ...props.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { HelixLoader } from "@/components/ui/loaders-dna"export function Example() {  return <HelixLoader size="lg" label="Analyzing sequence" />}```

Files & dependencies

  • registry/ai2/styled/loaders-dna.tsx→ components/ui/loaders-dna.tsx
dependenciesmotion@^12.42.2
registryDependencies@ai2/tokens

Looks similar, elsewhere