Develop ultra fast with Prismane 🎉

Radio

Radio displays a group of fields that handles toggling between multiple values.

Import

import { Radio } from "@prismane/core";

Radio component has the following inner components:

  • - Radio.Group - The container that groups the radio inputs.

Usage

function Demo() {
  const [value, setValue] = useState("yes");

  return (
    <Radio.Group
      name="answer"
      value={value}
      onChange={(e) => setValue(e.target.value)}
    >
      <Radio value="yes" label="Yes" />
      <Radio value="no" label="No" />
    </Radio.Group>
  );
}

API

Please refer to the documentation below for a comprehensive overview of all the available props and classes for the mentioned components.