@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
26 lines • 1.27 kB
TypeScript
import * as React from 'react';
import { SegmentedControlButtonProps } from './SegmentedControlButton';
export interface SegmentedControlProps {
/**
* The Button children of the SegmentedControl (must be at least two).
* TODO: Add support for text children
*/
children: React.ReactElement<SegmentedControlButtonProps>[];
/**
* The value or index of the Button that the SegmentedControl should be toggled on to.
* If a string is provided, the Button with the corresponding value will be selected.
* If a number is provided, the Button with the corresponding index will be selected.
* @default 0
*/
value?: string | number;
/**
* The function called when a button in the SegmentedControl is toggled.
* If the selected button has a value, that value will be passed to the callback function;
* otherwise, the index of the button will be passed.
*/
onChange?: (value: string | number) => void;
}
export declare const SegmentedControl: import("@workday/canvas-kit-react/common").ElementComponent<"div", SegmentedControlProps> & {
Button: import("@workday/canvas-kit-react/common").ElementComponent<"button", SegmentedControlButtonProps>;
};
//# sourceMappingURL=SegmentedControl.d.ts.map