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
Top level component for a custom block.
JSX JSON
Copy {
"type" : "block" ,
"children" : [
...
]
}
*required
vstack
Flex layout element to render a vertical stack of elements. Use spacer
, divider
, and box
to complete the layout.
JSX JSON Examples
Copy < vstack style = "start" >
...
</ vstack >
Copy {
"type" : "vstack" ,
"align" : "start" ,
"children" : [
...
]
}
Basic vertical stack:
Copy {
"type": "vstack",
"children": [
{ "type": "box", "children": [ { "type": "text", "children": ["Hello"] } ] },
{ "type": "box", "children": [ { "type": "text", "children": ["World"] } ] }
]
}
with align
:
Copy {
"type": "vstack",
"align": "center",
"children": [
{ "type": "box", "children": [ { "type": "text", "children": ["Hello"] } ] },
{ "type": "box", "children": [ { "type": "text", "children": ["And a long text"] } ] }
]
}
*required
hstack
Flex layout element to render an horizontal stack of elements. Use spacer
, divider
, and box
to complete the layout.
JSX JSON Examples
Copy < hstack style = "start" >
...
</ hstack >
Copy {
"type" : "hstack" ,
"align" : "start" ,
"children" : [
...
]
}
Basic horizontal stack:
Copy {
"type": "hstack",
"children": [
{ "type": "box", "children": [ { "type": "text", "children": ["Hello"] } ] },
{ "type": "box", "children": [ { "type": "text", "children": ["World"] } ] }
]
}
with align
:
Copy {
"type": "hstack",
"align": "center",
"children": [
{ "type": "box", "children": [ { "type": "text", "children": ["Hello"] } ] },
{ "type": "box", "children": [ { "type": "text", "children": ["And a long text"] } ] }
]
}
*required
divider
A visual delimiter between 2 elements of a containing stack layout.
JSX JSON
Copy {
"type" : "divider"
}
Display
box
JSX JSON
Copy < box style = "card" >
...
</ box >
Copy {
"type" : "box" ,
"style" : "card" ,
"children" : [
...
]
}
*required
card
JSX JSON
Copy < card title = "I am a card" >
...
</ card >
Copy {
"type" : "card" ,
"text" : "I am a card" ,
"children" : [
...
]
}
*required
text
The text element is used for rendering blocks of text with formatting.
JSX JSON Examples
Copy < text >
Hello < text style = "bold" >World</ text >
</ text >
Copy {
"type" : "text" ,
"children" : [
"Hello " ,
{
"type" : "text" ,
"children" : [ "World" ] ,
"style" : "bold"
}
]
}
Basic text:
Copy {
"type": "text",
"children": ["Hello"]
}
With nested formatting:
Copy {
"type": "text",
"children": [
"Hello ",
{
"type": "text",
"style": "bold",
"children": ["World"]
}
]
}
*required
image
The image component allows you to use images in your integration.
JSX
Copy < image
source = {{
url : "https://example.com/image.png"
}}
aspectRatio = { 16 / 9 }
/>
*required
markdown
Rich-text formatting of Markdown content.
JSX JSON
Copy < markdown content = "Hello **world**" />
Copy {
"type" : "markdown" ,
"content" : "Hello **world**"
}
*required
Interactive
modal
Overlay modal
JSX JSON
Copy {
"type" : "button" ,
"label" : "Click me" ,
"onPress" : { "type" : "something" }
}
*required
button
Interactive pressable button, triggering a component action when clicked.
JSX JSON Examples
Copy < button label = "Click me" onPress = {{ type : 'something' }} />
Copy {
"type" : "button" ,
"label" : "Click me" ,
"onPress" : { "type" : "something" }
}
Basic button:
Copy {
"type": "button",
"label": "Click me",
"onPress": { "type": "something" }
}
With an icon:
Copy {
"type": "button",
"label": "Click me",
"icon": "maximize",
"onPress": { "type": "something" }
}
With a tooltip:
Copy {
"type": "button",
"label": "Click me",
"tooltip": "More text here",
"onPress": { "type": "something" }
}
With a confirm modal:
Copy {
"type": "button",
"label": "Click me",
"confirm": {
"title": "Confirm the action",
"text": "Help text here",
"confirm": "Ok"
},
"onPress": { "type": "something" }
}
*required
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
.
JSX JSON Examples
Copy < textinput
id = "name"
label = "Name"
initialValue = "John Doe"
placeholder = "Enter a name"
/>
Copy {
"type" : "textinput" ,
"state" : "name" ,
"label" : "Name" ,
"initialValue" : "John Doe" ,
"placeholder" : "Enter a name"
}
Basic textinput:
Copy {
"type": "textinput",
"state": "name",
"label": "Name",
"initialValue": "John Doe",
"placeholder": "Enter a name"
}
*required
codeblock
Multi-lines code blocks with syntax highlighting.
JSX JSON
Copy < codeblock content = "const variable = 10" syntax = "javascript" />
Copy {
"type" : "codeblock" ,
"content" : "const variable = 10" ,
"syntax" : "javascript"
}
*required
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).
JSX JSON
Copy < webframe
source = {{ url : 'https://www.gitbook.com' }}
aspectRatio = { 16 / 9 }
/>
Copy {
"type" : "webframe" ,
"source" : {
"url" : "https://www.gitbook.com"
} ,
"aspectRatio" : 1.7
}
*required
select
Select item
JSX JSON
Copy < select state >
...
</ select >
Copy {
"type" : "select" ,
}
*required
switch
A switch component to toggle between on and off.
JSX JSON
Copy {
"type" : "switch" ,
}
*required
checkbox
A checkbox component to toggle between checked and unchecked.
JSX JSON
Copy {
"type" : "checkbox" ,
}
*required
radio
A radio component.
*required