Radio
js
import Radio from "@/components/Radio";
const Example = () => {
const [value, setValue] = useState("A");
const [value2, setValue2] = useState("C");
const handleChange = (e) => {
setValue(e.target.value);
};
return (
<div>
<Radio
label="Checked"
name="x"
value="A"
checked={value === "A"}
onChange={handleChange}
/>
<Radio
label="UnChecked"
name="x"
value="B"
checked={value === "B"}
onChange={handleChange}
/>
</div>
);
};