MynaUI
No results found.
Theme
Toggle Theme (Dark)
Documentation
Getting Started
Design System
Changelog
FAQ
Legal
Icons
Elements
Accordion
Alert Dialog
Alert
Avatar Groups
Avatar
Badge
Breadcrumb
Button Groups
Button
Calendar
Combobox
Command
Context Menu
Data Table
Dialog
Drawer
Dropdown Menu
Menubar
Pagination
Popover
Progress
Rating
Sheet
Skeleton
Spinner
Table
Tabs
Toast
Toggle and Toggle Group
Tooltip
Forms
Checkbox
Date Picker
Input OTP
Input
Radio
Select
Slider
Switch
Textarea
Marketing
404
Banners
Blog List
Blog Post
Call to Action
Cookies
FAQ
Features
Footer
Header
Hero
Newsletters
Statistics
Testimonial Logos
Application
App Headers
App Sheets
Application Dialogs
Card Headers
Cards
Containers
Dividers
Empty States
Forgot Password
Login
Notifications
Registration
Section Headers
Documentation
  • Getting Started
  • Copybook New
  • Design System
  • Icons
  • Changelog
  • Legal
  • Figma
  • Request Components
  • Request Icons
Elements
  • Accordion
  • Alert Dialog
  • Alert
  • Avatar Groups
  • Avatar
  • Badge
  • Breadcrumb
  • Button Groups
  • Button
  • Calendar
  • Combobox
  • Command
  • Context Menu
  • Data Table
  • Dialog
  • Drawer
  • Dropdown Menu
  • Menubar
  • Pagination
  • Popover
  • Progress
  • Rating
  • Sheet
  • Skeleton
  • Spinner
  • Table
  • Tabs
  • Toast
  • Toggle and Toggle Group
  • Tooltip
Forms
  • Checkbox
  • Date Picker
  • Input OTP
  • Input
  • Radio
  • Select
  • Slider
  • Switch
  • Textarea
Marketing
  • 404
  • Banners
  • Blog List
  • Blog Post
  • Call to Action
  • Cookies
  • FAQ
  • Features
  • Footer
  • Header
  • Hero
  • Newsletters
  • Statistics
  • Testimonial Logos
Application
  • App Headers
  • App Sheets
  • Application Dialogs
  • Card Headers
  • Cards
  • Containers
  • Dividers
  • Empty States
  • Forgot Password
  • Login
  • Notifications
  • Registration
  • Section Headers
Newsletter

Get the latest news and updates from MynaUI

Subscribe for Updates

Radio

Radio buttons are used to select one option from a list.

import { Label } from "@/components/ui/label";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";

export default function Basic() {
  return (
    <RadioGroup defaultValue="option-one">
      <div className="flex items-center gap-2">
        <RadioGroupItem value="basic-one" id="basic-one" />
        <Label htmlFor="basic-one">I accept</Label>
      </div>
      <div className="flex items-center gap-2">
        <RadioGroupItem value="basic-two" id="basic-two" />
        <Label htmlFor="basic-two">I do not accept</Label>
      </div>
    </RadioGroup>
  );
}
import { Label } from "@/components/ui/label";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";

export default function Disabled() {
  return (
    <RadioGroup defaultValue="option-one" disabled>
      <div className="flex items-center gap-2">
        <RadioGroupItem
          value="disabled-one"
          id="disabled-one"
          disabled
          checked
        />
        <Label htmlFor="disabled-one">I accept</Label>
      </div>
      <div className="flex items-center gap-2">
        <RadioGroupItem value="disabled-two" id="disabled-two" disabled />
        <Label htmlFor="disabled-two">I do not accept</Label>
      </div>
    </RadioGroup>
  );
}
import { Label } from "@/components/ui/label";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";

export default function RadioError() {
  return (
    <RadioGroup defaultValue="option-one">
      <div className="flex items-center gap-2">
        <RadioGroupItem value="error-one" id="error-one" />
        <Label htmlFor="error-one">I accept</Label>
      </div>
      <div className="flex items-center gap-2">
        <RadioGroupItem value="error-two" id="error-two" />
        <Label htmlFor="error-two">I do not accept</Label>
      </div>
      <p className="text-xs font-medium text-red-600">
        You have to accept to continue
      </p>
    </RadioGroup>
  );
}
import { Label } from "@/components/ui/label";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";

export default function Horizontal() {
  return (
    <RadioGroup className="space-y-2">
      <legend className="text-sm font-medium text-muted-foreground">
        Privacy:
      </legend>
      <div className="flex flex-col space-y-2 md:flex-row md:space-x-6 md:space-y-0">
        <div className="flex items-center gap-2">
          <RadioGroupItem value="private-one" id="private-one" />
          <Label htmlFor="private-one">Private (Only Me)</Label>
        </div>
        <div className="flex items-center gap-2">
          <RadioGroupItem value="link-one" id="link-one" />
          <Label htmlFor="link-one">Shared via Link</Label>
        </div>
        <div className="flex items-center gap-2">
          <RadioGroupItem value="public-one" id="public-one" />
          <Label htmlFor="public-one">Public</Label>
        </div>
      </div>
    </RadioGroup>
  );
}
import { Label } from "@/components/ui/label";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";

export default function WithDescription() {
  return (
    <RadioGroup className="space-y-4">
      <div className="flex gap-2">
        <RadioGroupItem value="tasks-one" id="tasks-one" />
        <Label htmlFor="tasks-one" className="flex-col items-start">
          <span>Tasks</span>
          <span className="font-normal text-muted-foreground">
            Get notified if there are new tasks added to your project, or if a
            task is completed.
          </span>
        </Label>
      </div>
      <div className="flex gap-2">
        <RadioGroupItem value="projects-one" id="projects-one" />
        <Label htmlFor="projects-one" className="flex-col items-start">
          <span>Projects</span>
          <span className="font-normal text-muted-foreground">
            Get notified if there&#x27;s are new projects added to your teams.
          </span>
        </Label>
      </div>
    </RadioGroup>
  );
}

Not affiliated with Figma, TailwindCSS or shadcn/ui.

X (Twitter) Logo Dribbble Logo Figma Logo