Skip to main content

Input.Radio

Import

import { Input } from "@dhua5922/react-native-kit";

Examples

Live Editor
function Example() {
  const [checked1, setChecked1] = useState(false);
  const [checked2, setChecked2] = useState(false);

  return (
    <>
      <Input.Radio
        checked={checked1}
        onChange={(checked) => setChecked1(checked)}
        style={{ marginBottom: 12 }}
      >
        Radio 1
      </Input.Radio>

      <Input.Radio
        checked={checked2}
        onChange={(checked) => setChecked2(checked)}
        disabled
      >
        Disabled radio
      </Input.Radio>
    </>
  );
}
Result
Loading...

Props

note

Include all props from Pressable

NameTypeDefaultDescription
checkedbooleanfalseShow radio as chosen; otherwise, show radio as not chosen.
onChange(checked: boolean) => voidCallback fired when radio has been pressed.
sizenumber24Width and height of radio.
colorstring#2089dcColor of radio.