alwkala

Radio

Forms

About

A styled radio button input with optional label and description text, for building radio groups and option lists.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Radio to your project and fits it to your theme.

Code

How Radio is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import Radio from "@/components/ui/radio";
import { useState } from "react";

export default function RadioDemo() {
  const [plan, setPlan] = useState("pro");

  return (
    <div className="flex w-full max-w-sm flex-col gap-4 p-6">
      <Radio
        name="plan"
        value="free"
        checked={plan === "free"}
        onChange={() => setPlan("free")}
        label="Free"
        description="Basic features for individuals getting started."
      />
      <Radio
        name="plan"
        value="pro"
        checked={plan === "pro"}
        onChange={() => setPlan("pro")}
        label="Pro"
        description="Advanced features for growing teams."
      />
      <Radio
        name="plan"
        value="enterprise"
        checked={plan === "enterprise"}
        onChange={() => setPlan("enterprise")}
        label="Enterprise"
        description="Custom solutions with dedicated support, currently unavailable."
        disabled
      />
    </div>
  );
}

More by alwkala

View all
  • Callout

    Callout

    10
  • Progress Bar

    Progress Bar

    3
  • Breadcrumb

    Breadcrumb

    1
  • Navbar

    Navbar

    1
  • Kbd

    Kbd

  • Pagination

    Pagination

  • Back To Top

    Back To Top

  • Checkbox

    Checkbox

More in Forms

View all
  • Premium Auth

    Premium Auth

    593
  • Contact Form

    Contact Form

    28
  • Form

    Form

    4
  • Login 1

    Login 1

    70
  • Book A Demo 1

    Book A Demo 1

    94
  • Contact Card

    Contact Card

    1.1K
  • HeroUI Field Error

    HeroUI Field Error

    13
  • Form [react-aria-components]

    Form [react-aria-components]

    19