SaasRock Logo

Radio Group Input

InputRadioGroup

import { useState } from "react";
import InputRadioGroup from "~/components/ui/input/InputRadioGroup";

type SelectType = string | number | undefined;
export default function PreviewInputRadioGroupWithState() {
  const [value, setValue] = useState<SelectType>(2);
  return (
    <InputRadioGroup
      name="name"
      title="Title"
      options={[
        {
          name: "Option 1",
          value: 1,
        },
        {
          name: "Option 2",
          value: 2,
        },
        {
          name: "Option 3",
          value: 3,
          disabled: true,
        },
      ]}
      value={value}
      setValue={setValue}
    />
  );
}