infinity-ui-elements
Version:
A React TypeScript component library with Tailwind CSS design system
140 lines • 3.27 kB
TypeScript
import * as React from "react";
export interface RadioOption {
/**
* The value of the radio option
*/
value: string;
/**
* The label text for the radio option
*/
label: string;
/**
* Whether this option is disabled
*/
isDisabled?: boolean;
/**
* Custom class name for the option container
*/
containerClassName?: string;
/**
* Custom class name for the option label
*/
labelClassName?: string;
}
export interface RadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
/**
* Selected value (controlled)
*/
value?: string;
/**
* Default selected value (uncontrolled)
*/
defaultValue?: string;
/**
* Callback when selection changes
*/
onChange?: (value: string) => void;
/**
* Array of radio options
*/
options?: RadioOption[];
/**
* Custom radio buttons as children (alternative to options)
*/
children?: React.ReactNode;
/**
* Label for the radio group
*/
label?: string;
/**
* Helper text below the radio group
*/
helperText?: string;
/**
* Error text (overrides helperText when present)
*/
errorText?: string;
/**
* Success text (overrides helperText when present)
*/
successText?: string;
/**
* Validation state for the radio group
*/
validationState?: "none" | "error";
/**
* Whether the radio group is disabled
*/
isDisabled?: boolean;
/**
* Whether the radio group is required
*/
isRequired?: boolean;
/**
* Whether the radio group is optional
*/
isOptional?: boolean;
/**
* Size of the radio buttons
*/
size?: "small" | "medium" | "large";
/**
* Name attribute for the radio inputs (auto-generated if not provided)
*/
name?: string;
/**
* Orientation of the radio group
*/
orientation?: "horizontal" | "vertical";
/**
* Spacing between radio options
*/
spacing?: "tight" | "normal" | "loose";
/**
* Visual variant for the radio group
*/
variant?: "default" | "card";
/**
* Custom class for the container
*/
containerClassName?: string;
/**
* Custom class for the label
*/
labelClassName?: string;
/**
* Custom class for the radio group wrapper
*/
groupClassName?: string;
/**
* Custom class for each radio card container (when variant="card")
*/
cardClassName?: string;
/**
* Info heading for tooltip
*/
infoHeading?: string;
/**
* Info description for tooltip
*/
infoDescription?: string;
/**
* Custom Link component to render on the right side
*/
LinkComponent?: React.ReactNode;
/**
* Link text
*/
linkText?: string;
/**
* Link href
*/
linkHref?: string;
/**
* Link click handler
*/
onLinkClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
}
declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
export { RadioGroup };
//# sourceMappingURL=RadioGroup.d.ts.map