a11ypros

Accessible Radio Group

Forms 1

About

A WCAG-compliant radio button group for selecting one option from a list, with fieldset-style grouping, error and helper text, and full ARIA/keyboard support. Ported from A11Y Pros' a11y-radio web component, mirroring their original React Radio implementation, licensed MIT.

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

Code

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

Usage.tsx

"use client";

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

export default function RadioErrorDemo() {
  const [value, setValue] = useState("");
  return (
    <Radio
      name="radio-error"
      label="Select a payment method"
      value={value}
      onChange={(e) => setValue(e.target.value)}
      error="Please select a payment method"
      options={[
        { value: "credit", label: "Credit card" },
        { value: "paypal", label: "PayPal" },
        { value: "bank", label: "Bank transfer" },
      ]}
    />
  );
}

More by a11ypros

View all
  • Accessible Accordion

    Accessible Accordion

    6
  • Accessible Tooltip

    Accessible Tooltip

    5
  • A11y Label

    A11y Label

    2

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