jsx-slack
Version:
Build JSON object for Slack Block Kit surfaces from JSX
37 lines (36 loc) • 1.35 kB
TypeScript
import { JSXSlack } from '../../jsx';
import { LayoutBlockProps } from './utils';
interface ContextProps extends LayoutBlockProps {
children: JSXSlack.ChildElements;
}
/**
* [The `context` layout block](https://api.slack.com/reference/messaging/blocks#context)
* to display the message context with small texts and icon images.
*
* `<Context>` allows containing mixed contents consisted of text messages
* formatted by HTML-like elements and `image` block elements generated by
* `<Image>` component. Elements for `context` layout block will generate from
* them cleverly.
*
* ```jsx
* <Blocks>
* <Context>
* <Image src="https://placekitten.com/100/100" alt="Kitten" />
* A kitten and
* <Image src="https://placekitten.com/100/100" alt="Kitten" />
* more kitten.
* </Context>
* </Blocks>
* ```
*
* And you also can define the text element explicitly through `<span>` tag and
* `<Mrkdwn>` text composition object.
*
* **NOTE**: Slack restricts the number of elements up to 10. jsx-slack throws
* an error if the number of generated elements was going over the limit.
*
* @return The partial JSON for `context` layout block
* @throws Will throw an error if there are 10 or more generated elements.
*/
export declare const Context: import("../../jsx-internals").BuiltInComponent<ContextProps>;
export {};