Inputs
Radio

Radio

Content selection and state toggles

Anatomy

import { Radio } from "@lualtek/react-components";
 
export default () => {
  return <Radio label="Label 2" />;
};

API Reference

export type RadioProps = InputHTMLAttributes<HTMLInputElement> & {
  /**
   * Set disabled state. The component is not interactive and grayed out.
   */
  disabled?: boolean;
  /**
   * Set the size of the toggle.
   * @default 'regular'
   */
  dimension?: "regular" | "small";
 
  /**
   * Callback function to be called when is toggled.
   * A parameter `ChangeEvent<HTMLInputElement>` is passed with the event details
   */
  onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
 
  /**
   * Assign a label to the input. If passed an ID is automatically generated and used internally
   */
  label?: ReactNode;
 
  /**
   * Set the position of the label relative to the radio.
   * @default 'end'
   */
  labelPosition?: "start" | "end";
};