{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "p-radio-group-5",
  "description": "Radio group in form",
  "registryDependencies": [
    "@coss/button",
    "@coss/field",
    "@coss/fieldset",
    "@coss/form",
    "@coss/radio-group"
  ],
  "files": [
    {
      "path": "registry/default/particles/p-radio-group-5.tsx",
      "content": "\"use client\";\n\nimport type { FormEvent } from \"react\";\nimport { useState } from \"react\";\nimport { Button } from \"@/registry/default/ui/button\";\nimport { Field, FieldItem, FieldLabel } from \"@/registry/default/ui/field\";\nimport { Fieldset, FieldsetLegend } from \"@/registry/default/ui/fieldset\";\nimport { Form } from \"@/registry/default/ui/form\";\nimport { Radio, RadioGroup } from \"@/registry/default/ui/radio-group\";\n\nexport default function Particle() {\n  const [loading, setLoading] = useState(false);\n\n  const onSubmit = async (e: FormEvent<HTMLFormElement>) => {\n    e.preventDefault();\n    const formData = new FormData(e.currentTarget);\n    setLoading(true);\n    await new Promise((r) => setTimeout(r, 800));\n    setLoading(false);\n    alert(`Selected: ${formData.get(\"frameworks\")}`);\n  };\n\n  return (\n    <Form className=\"max-w-[160px]\" onSubmit={onSubmit}>\n      <Field\n        className=\"gap-4\"\n        name=\"frameworks\"\n        render={(props) => <Fieldset {...props} />}\n      >\n        <FieldsetLegend className=\"font-medium text-sm\">\n          Frameworks\n        </FieldsetLegend>\n        <RadioGroup defaultValue=\"next\">\n          <FieldItem>\n            <FieldLabel>\n              <Radio value=\"next\" /> Next.js\n            </FieldLabel>\n          </FieldItem>\n          <FieldItem>\n            <FieldLabel>\n              <Radio value=\"vite\" /> Vite\n            </FieldLabel>\n          </FieldItem>\n          <FieldItem>\n            <FieldLabel>\n              <Radio value=\"astro\" /> Astro\n            </FieldLabel>\n          </FieldItem>\n        </RadioGroup>\n      </Field>\n      <Button loading={loading} type=\"submit\">\n        Submit\n      </Button>\n    </Form>\n  );\n}\n",
      "type": "registry:block"
    }
  ],
  "categories": [
    "radio group",
    "form"
  ],
  "type": "registry:block"
}