@carbon/ibm-products
Version:
Carbon for IBM Products
49 lines (48 loc) • 2.15 kB
TypeScript
/**
* Copyright IBM Corp. 2021, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import { ButtonProps } from '@carbon/react';
export declare const ButtonSizes: readonly ["sm", "md", "lg", "xl", "2xl"];
export type ButtonSize = (typeof ButtonSizes)[number];
export interface ActionSetProps {
/**
* The action buttons to show. Each action is specified as an object
* representation of a Carbon button.
*
* See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
*/
actions: ButtonProps<React.ElementType>[];
/**
* The size of buttons to use for the actions. The allowed values are
* those for the size prop of carbon Button. If this prop is specified, all
* the buttons will be set to this size, overriding any 'size' values (if any)
* supplied in the actions array (if any).
*/
buttonSize?: ButtonSize;
/**
* An optional class or classes to be added to the outermost element.
*/
className?: string;
/**
* The size of the action set. Different button arrangements are used at
* different sizes, to make best use of the available space.
*/
size?: ButtonSize;
}
/**
* An ActionSet presents a set of action buttons, constructed from bundles
* of prop values and applying some layout rules. When the size is 'sm'
* the buttons are stacked, and should only include primary and secondary
* kinds. When the size is 'md' the buttons are stacked if there are three or
* more. When the size is 'md' or 'lg', two buttons share the horizontal space.
* When the size is 'lg', three or more buttons use a quarter of the available
* horizontal space, and if the size is 'xlg' or 'max' the buttons always use
* a quarter of the available horizontal space. If there is a ghost button,
* it appears at the left side. If there is a primary button it appears at the
* right.
*/
export declare const ActionSet: React.ForwardRefExoticComponent<ActionSetProps & React.RefAttributes<HTMLDivElement>>;