a11ypros

Accessible Radio Group

Forms

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 Tooltip

    Accessible Tooltip

    1
  • Accessible Accordion

    Accessible Accordion

    1
  • A11y Label

    A11y Label

More in Forms

View all
  • Premium Auth

    Premium Auth

    500
  • Login 2

    Login 2

    7
  • Authentication Card

    Authentication Card

    47
  • Login 1

    Login 1

    52
  • Contact Card

    Contact Card

    1K
  • Login Form

    Login Form

    6
  • Form

    Form

    16
  • Book A Demo 3

    Book A Demo 3

    83