{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "loading",
  "type": "registry:component",
  "title": "Loading states",
  "description": "Spinners, progress, skeletons and the in-between states nobody designs until it's too late. Drawn by hand, honest about time, quiet for screen readers and still under reduced motion.",
  "categories": [
    "feedback"
  ],
  "dependencies": [
    "@plop-ui/react",
    "@plop-ui/fonts"
  ],
  "registryDependencies": [
    "https://plopui.com/r/plop-setup.json"
  ],
  "files": [
    {
      "path": "registry/plopui/loading-example.tsx",
      "type": "registry:component",
      "target": "components/plop/loading-example.tsx",
      "content": "\"use client\";\n\nimport { useState } from \"react\";\nimport { Avatar, Button, Loader, Progress, ProgressRing, Select, SkeletonText, Spinner, useDelayedLoading } from \"@plop-ui/react\";\n\n/** Loading states: spinners, progress, skeletons, built-in loading props, and a loader card. */\nexport function LoadingExample() {\n  const [sending, setSending] = useState(false);\n  const [loading, setLoading] = useState(true);\n  // Show a spinner only if the wait passes 300 ms, so quick loads never flicker.\n  const showSpinner = useDelayedLoading(loading);\n\n  return (\n    <>\n      <Spinner label=\"Loading sketches\" />\n      <Spinner kind=\"dots\" showLabel label=\"Saving your board\" />\n      <Button\n        loading={sending}\n        loadingLabel=\"Sending\"\n        onClick={() => {\n          setSending(true);\n          setTimeout(() => setSending(false), 1500);\n        }}\n      >\n        Send report\n      </Button>\n\n      <Progress label=\"Syncing reports\" value={4} max={10} valueText=\"4 of 10\" />\n      <Progress label=\"Finding a free table\" indeterminate />\n      <ProgressRing label=\"Uploading photos\" value={64} />\n\n      <section aria-busy={loading}>\n        {loading ? <SkeletonText lines={3} /> : <p>Here's the note that was loading.</p>}\n      </section>\n      <Button variant=\"plain\" onClick={() => setLoading((l) => !l)}>\n        {loading ? \"Finish loading\" : \"Load again\"}\n      </Button>\n      {showSpinner && <Spinner label=\"Still loading\" />}\n\n      {/* Built in: one prop, no custom CSS. */}\n      <Select label=\"Brush\" options={[]} loading />\n      <Avatar name=\"Rosa Santos\" loading />\n\n      <Loader variant=\"card\" paper=\"dots\" label=\"Pressing your page\" slowAfter={4000} onCancel={() => setLoading(false)} />\n    </>\n  );\n}\n"
    }
  ],
  "docs": "Example: components/plop/loading-example.tsx. Docs: https://plopui.com/docs/components/loading"
}
