UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

32 lines 1.79 kB
import * as React from 'react'; import { SegmentedControlButtonProps } from './SegmentedControlButton'; /** * @deprecated ⚠️ `SegmentedControlProps` in Main has been deprecated and will be removed in a future major version. Please use [`SegmentedControl` in Preview](https://workday.github.io/canvas-kit/?path=/docs/preview-segmented-control--docs) instead. */ 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; } /** * @deprecated ⚠️ `SegmentedControl` in Main has been deprecated and will be removed in a future major version. Please use [`SegmentedControl` in Preview](https://workday.github.io/canvas-kit/?path=/docs/preview-segmented-control--docs) instead. */ 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