UNPKG

jsx-slack

Version:

Build JSON object for Slack Block Kit surfaces from JSX

52 lines (51 loc) 1.86 kB
import { JSXSlack } from '../../jsx'; import { BuiltInComponent } from '../../jsx-internals'; import { ConfirmableProps } from '../composition/Confirm'; import { InputComponentProps } from '../layout/Input'; import { ActionProps, AutoFocusibleProps } from './utils'; interface CheckboxGroupBaseProps extends ActionProps, AutoFocusibleProps, ConfirmableProps { children: JSXSlack.ChildNodes; /** * An array of values for initially selected checkboxes. * * They must choose a string of `value` prop from defined `<Checkbox>` * elements in children. If not defined, initally checked states will follow * the state of `<Checkbox checked>`. */ values?: string[] | null; } type CheckboxGroupProps = InputComponentProps<CheckboxGroupBaseProps>; /** * The interactive component or input component for * [the `checkboxes` element](https://api.slack.com/reference/block-kit/block-elements#checkboxes). * * Provide the container to choose multiple options supplied by `<Checkbox>`. * * @example * ```jsx * <Modal title="Quick survey"> * <CheckboxGroup * blockId="foods" * actionId="foods" * label="What do you want to eat for the party in this Friday?" * required * > * <Checkbox value="burger">Burger :hamburger:</Checkbox> * <Checkbox value="pizza">Pizza :pizza:</Checkbox> * <Checkbox value="taco">Tex-Mex taco :taco:</Checkbox> * <Checkbox value="sushi">Sushi :sushi:</Checkbox> * <Checkbox value="others"> * Others * <small> * <i>Let me know in a message!</i> * </small> * </Checkbox> * </CheckboxGroup> * </Modal> * ``` * * @return The partial JSON of a block element for the container of checkboxes, * or `input` layout block with it */ export declare const CheckboxGroup: BuiltInComponent<CheckboxGroupProps>; export {};