react-antd-admin-panel
Version:
Modern TypeScript-first React admin panel builder with Ant Design 6
51 lines • 1.55 kB
TypeScript
import React from 'react';
import { FormFieldBuilder, FormFieldBuilderConfig } from '../base/FormFieldBuilder';
export interface RadioOption<T = any> {
label: string;
value: T;
disabled?: boolean;
}
export interface RadioGroupConfig<T = any> extends FormFieldBuilderConfig {
options?: RadioOption<T>[];
direction?: 'horizontal' | 'vertical';
buttonStyle?: 'outline' | 'solid';
optionType?: 'default' | 'button';
size?: 'large' | 'middle' | 'small';
}
/**
* RadioGroup Field Builder
* Wrapper for Ant Design Radio.Group component with generics
* @template T - The type of radio option values
*/
export declare class RadioGroup<T = any> extends FormFieldBuilder<RadioGroupConfig<T>, T> {
/**
* Set radio options
*/
options(opts: RadioOption<T>[]): this;
/**
* Add a single radio option
*/
option(label: string, value: T, disabled?: boolean): this;
/**
* Set layout direction
*/
direction(dir: 'horizontal' | 'vertical'): this;
/**
* Set button style (only applies when optionType is 'button')
*/
buttonStyle(style: 'outline' | 'solid'): this;
/**
* Set option type (default radio or button style)
*/
optionType(type: 'default' | 'button'): this;
/**
* Set size (only applies when optionType is 'button')
*/
size(value: 'large' | 'middle' | 'small'): this;
/**
* Render the radio group component
*/
render(): React.ReactNode;
}
export { RadioGroup as Radio };
//# sourceMappingURL=Radio.d.ts.map