An Indigo-themed radio button component for mutually exclusive selections. Features smooth transitions and precise alignment.
The outer flex container that maintains alignment and defines the interactive area.
The outer circular boundary that indicates focus and selection intent.
The Indigo-600 center dot that appears only when the radio is selected.
Accessible text label that triggers selection within the radio group.
// ExperimentRadio.tsx
const ExperimentRadio = ({ checked, label, onChange }) => (
<label className="flex items-center gap-3 cursor-pointer">
<input type="radio" className="sr-only" checked={checked} onChange={onChange} />
<div className={`w-4.5 h-4.5 border-2 rounded-full flex items-center justify-center ${checked ? 'border-indigo-600' : 'border-macos-gray-300'}`}>
{checked && <div className="w-2.5 h-2.5 bg-indigo-600 rounded-full" />}
</div>
<span className="text-sm font-medium">{label}</span>
</label>
);