@syncfusion/react-buttons
Version:
Syncfusion React Buttons package is a feature-rich collection of UI components including Button, CheckBox, RadioButton, Switch, Chip, and more for building modern, interactive React applications.
93 lines (92 loc) • 3.07 kB
TypeScript
import * as React from 'react';
import { InputHTMLAttributes } from 'react';
import { Color, Size, LabelPlacement } from '@syncfusion/react-base';
export { LabelPlacement };
/**
* Interface for RadioButton change event arguments
*/
export interface RadioButtonChangeEvent {
/**
* The initial event object received from the input element.
*/
event: React.ChangeEvent<HTMLInputElement>;
/**
* The selected value of the RadioButton.
*/
value: string;
}
/**
* Defines the properties for the RadioButton component.
*/
export interface RadioButtonProps {
/**
* Specifies whether the RadioButton is `checked` (`true`) or unchecked (`false`). Use for controlled components.
*
* @default false
*/
checked?: boolean;
/**
* Specifies the initial checked state of the RadioButton. Use for uncontrolled components.
*
* @default false
*/
defaultChecked?: boolean;
/**
* Defines the caption for the RadioButton, that describes the purpose of the RadioButton.
*
* @default -
*/
label?: string;
/**
* Specifies the size style of the checkbox. Options include 'Small', 'Medium' and 'Large'.
*
* @default Size.Medium
*/
size?: Size;
/**
* Specifies the Color style of the radio-button. Options include 'Primary', 'Secondary', 'Warning', 'Success', 'Error', and 'Info'.
*
* @default -
*/
color?: Color;
/**
* Specifies the position of the label relative to the RadioButton. It determines whether the label appears before or after the radio button element in the UI.
*
* @default LabelPlacement.After
*/
labelPlacement?: LabelPlacement;
/**
* Defines `value` attribute for the RadioButton. It is a form data passed to the server when submitting the form.
*
* @default -
*/
value?: string;
/**
* Event trigger when the RadioButton state has been changed by user interaction.
*
* @event onChange
*/
onChange?: (event: RadioButtonChangeEvent) => void;
}
export interface IRadioButton extends RadioButtonProps {
/**
* This is RadioButton component input element.
*
* @private
* @default null
*/
element?: HTMLInputElement | null;
}
type IRadioButtonProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'size'> & IRadioButton;
/**
* The RadioButton component allows users to select a single option from a group, utilizing a circular input field that provides a clear user selection interface.
*
* ```typescript
* import { RadioButton } from "@syncfusion/react-buttons";
*
* <RadioButton checked={true} label="Choose this option" name="choices" />
* ```
*/
export declare const RadioButton: React.ForwardRefExoticComponent<IRadioButtonProps & React.RefAttributes<IRadioButton>>;
declare const _default: React.NamedExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "onChange"> & IRadioButton & React.RefAttributes<IRadioButton>>;
export default _default;