@rws-air/webcomponents
Version:
Standard Webcomponents for AIR projects
46 lines • 2.32 kB
TypeScript
import React, { ReactNode } from 'react';
export interface DropdownbuttonProps {
/** The options to show in the dropdown menu */
options: string[];
/** Disable the entire dropdown button */
disabled?: boolean;
/** The icon displayed in the button to the right. This button is clicked to trigger {@link onClick()} */
ButtonIcon: ReactNode;
/** The maximum length of the text in the button before being cut off with ellipsis @default 30 */
maxTextLength?: number;
/** The default option to select, using zero-based index for {@link options} @default 0 */
defaultOptionId?: number;
/** Any options to disabled, using zero-based index for {@link options} */
disabledOptionIds?: number[];
/** The color type of the buttons @default primary */
color?: 'primary' | 'secondary' | 'inherit' | 'error' | 'info' | 'success' | 'warning' | undefined;
/** The variant of the buttons @default contained */
variant?: 'text' | 'outlined' | 'contained' | undefined;
/** Data-qa tags to apply to the button group */
buttonGroupDataQa?: string;
/** Data-qa tags to apply to the dropdown button */
dropdownButtonDataQa?: string;
/** Data-qa tags to apply to the icon button */
iconButtonDataQa?: string;
/** Data-qa tags to apply to each menu item */
menuItemDataQa?: string;
/** Data-qa tags to apply to the popper */
popperDataQa?: string;
/** Custom CSS classes to pass to the dropdown button */
dropdownButtonCustomClasses?: string | string[];
/** Custom CSS classes to pass to the icon button */
iconButtonCustomClasses?: string | string[];
/** Custom CSS classes to pass to the buttonGroup */
buttonGroupCustomClasses?: string | string[];
/** The action to trigger when the button with {@link ButtonIcon} is pressed. Receives the currently selected option as first parameter */
onClick(selectedOption: string): unknown;
}
/**
* Constructs a button with dropdown menu options using pre-defined Rijkswaterstaat styling
* @example
* ```jsx
* <Dropdownbutton ButtonIcon={<CloudDownload/>} onClick={() => undefined} options={[ 'one', 'two' ]} />
* ```
*/
export declare const Dropdownbutton: React.MemoExoticComponent<(props: DropdownbuttonProps) => JSX.Element>;
//# sourceMappingURL=index.d.ts.map