Components
Our reference for the ContentKit covers all the objects you will receive and respond with, alongside all the components you can use in order to render the UI for your integrations.
If you want to learn more about the ContentKit itself, alongside the different types of requests we make in order to make these work, please take a look at our introduction.
Components are divided into 3 different categories:
Layout: Components for structuring your integration
Display: Visual components for representing data and media
Interactive: Interactive components
Layout
block
block
Top level component for a custom block.
Props | Type | Description |
---|---|---|
|
| Content to display in the block. |
|
| Control menu items displayed for the block. |
| The icon to display with the control | |
|
| The label for the control |
|
| Action dispatched when control is pressed. See Actions for more information. |
|
| Modal object to display to ask the user to confirm the action before execution |
|
| Title for the confirmation button |
|
| Content for the confirmation button |
|
| Label for the confirmation button |
|
| Style for the confirmation button. |
*required
vstack
vstack
Flex layout element to render a vertical stack of elements. Use spacer
, divider
, and box
to complete the layout.
Props | Type | Description |
---|---|---|
|
| Content to display in the stack. |
|
| Horizontal alignment of the elements in the stack. |
*required
hstack
hstack
Flex layout element to render an horizontal stack of elements. Use spacer
, divider
, and box
to complete the layout.
Props | Type | Description |
---|---|---|
|
| Content to display in the stack. |
|
| Vertical alignment of the elements in the stack. |
*required
divider
divider
A visual delimiter between 2 elements of a containing stack layout.
Props | Type | Description |
---|---|---|
|
| Visual style for the divider. |
|
| Spacing of the divider (default to |
Display
box
box
Props | Type | Description |
---|---|---|
|
| Content to display in the block. |
|
| Visual style for the box. |
|
| Specifies how much of the remaining space in the container should be assigned to the element. |
*required
card
card
Props | Type | Description |
---|---|---|
|
| Content to display in the block. |
|
| Title for the card. |
|
| Hint for the card. |
| Icon or Image displayed with the card. | |
|
| Action dispatched when pressed. See Actions for more information. |
|
| Button(s) displayed in the top right corner of the card. |
*required
text
text
The text element is used for rendering blocks of text with formatting.
Props | Type | Description |
---|---|---|
|
| Content of the text element. |
|
| Style to format the text with. |
*required
image
image
The image component allows you to use images in your integration.
Props | Type | Description |
---|---|---|
|
| Content to load in the image. |
|
| URL of the image to load |
|
| Aspect ratio to use for the image. |
*required
markdown
markdown
Rich-text formatting of Markdown content.
Props | Type | Description |
---|---|---|
|
| Markdown text content to render |
*required
Interactive
modal
modal
Overlay modal
Props | Type | Description |
---|---|---|
|
| Block items to display inside the modal. |
|
| Title of the modal |
|
| Subtitle of the modal |
|
| Size of the modal |
|
| Data passed back to the parent view when the modal is closed. These data are accessible in the |
|
| Button instance that triggers an action. |
*required
button
button
Interactive pressable button, triggering a component action when clicked.
Props | Type | Description |
---|---|---|
|
| Text displayed in the button |
|
| Action to trigger when the button is pressed See Actions for more information. |
|
| Visual style for the button |
|
| Text displayed in an hovering tooltip |
| Visual icon to display on the start of the button | |
|
| Modal object to display to ask the user to confirm the action before execution |
|
| Title for the confirmation modal |
|
| Content of the confirmation modal |
|
| Label for the confirmation button |
|
| Style of the confirmation button |
*required
textinput
textinput
An input component is used to capture text input from the end user. When an action is being dispatched to the integration, the value of the input is stored in the state value referenced by id
.
Props | Type | Description |
---|---|---|
|
| State binding. The value of the input will be stored as a property in the state named after this ID. |
|
| Initial value of the input. |
|
| Label to display next to the input. |
|
| Text that appears in the form control when it has no value set |
*required
codeblock
codeblock
Multi-lines code blocks with syntax highlighting.
Props | Type | Description |
---|---|---|
|
| Text content for the codeblock |
|
| Syntax to use for highlighting |
|
| Control the display of the line numbers |
|
| Buttons to render as an overlay in top-right corner |
|
| Editable state binding. The value of the input will be stored as a property in the state named after this ID. Passing this property automatically makes the code-block editable. |
|
| Action dispatched when the user has edited the content of this code block. It only applies if a |
*required
webframe
webframe
Element to render an external URL. The frame can receive update when states are updated by defining dependencies with data
(see interactivity for more details).
Props | Type | Description |
---|---|---|
|
| Content to load in the frame |
|
| URL of the content to load |
|
| Aspect-ratio (width / height) for the block |
|
| Buttons to render as an overlay in top-right corner |
|
| States this webframe is depend on. Each state update will cause the webframe to receive a message. |
*required
select
select
Select item
Props | Type | Description |
---|---|---|
|
| State binding. The value of the input will be stored as a property in the state named after this ID. |
|
| The initial value for the select component |
|
| Placeholder value for the select component |
|
| Should the select accept the selection of multiple options. If true, the state will be an array. |
|
| Options for the select component |
|
| Unique ID for the option |
|
| Label for the option |
|
| URL for the option if using an external link |
*required
switch
switch
A switch component to toggle between on and off.
Props | Type | Description |
---|---|---|
|
| State binding. The value of the input will be stored as a property in the state named after this ID. |
|
| Value to initialize the switch with. |
|
| Modal object to display to ask the user to confirm the action before execution |
|
| Title for the confirmation button |
|
| Content for the confirmation button |
|
| Label for the confirmation button |
|
| Style for the confirmation button |
*required
checkbox
checkbox
A checkbox component to toggle between checked and unchecked.
Props | Type | Description |
---|---|---|
|
| State binding. The value of the input will be stored as a property in the state named after this ID. |
|
| Value to store in a state array when the checkbox is selected. |
|
| Modal object to display to ask the user to confirm the action before execution |
|
| Title for the confirmation button |
|
| Content for the confirmation button |
|
| Label for the confirmation button |
|
| Style for the confirmation button |
*required
radio
radio
A radio component.
Props | Type | Description |
---|---|---|
|
| State binding. The value of the input will be stored as a property in the state named after this ID. |
|
| Value to store in a state array when the checkbox is selected. |
|
| Modal object to display to ask the user to confirm the action before execution |
|
| Title for the confirmation button |
|
| Content for the confirmation button |
|
| Label for the confirmation button |
|
| Style for the confirmation button |
*required
Last updated