UNPKG

981 BTypeScriptView Raw
1import * as React from 'react';
2import { ButtonGroupProps } from './ButtonGroup';
3import { BsPrefixRefForwardingComponent } from './helpers';
4type BaseToggleButtonProps = Omit<ButtonGroupProps, 'toggle' | 'defaultValue' | 'onChange'>;
5export interface ToggleButtonRadioProps<T> extends BaseToggleButtonProps {
6 type?: 'radio';
7 name: string;
8 value?: T;
9 defaultValue?: T;
10 onChange?: (value: T, event: any) => void;
11}
12export interface ToggleButtonCheckboxProps<T> extends BaseToggleButtonProps {
13 type: 'checkbox';
14 name?: string;
15 value?: T[];
16 defaultValue?: T[];
17 onChange?: (value: T[]) => void;
18}
19export type ToggleButtonGroupProps<T> = ToggleButtonRadioProps<T> | ToggleButtonCheckboxProps<T>;
20declare const _default: BsPrefixRefForwardingComponent<"a", ToggleButtonGroupProps<any>> & {
21 Button: React.ForwardRefExoticComponent<import("./ToggleButton").ToggleButtonProps & React.RefAttributes<HTMLLabelElement>>;
22};
23export default _default;