Skip to content

Code Reference

Column

Bases: CamelModel

Defines a container that is part of a ColumnSet.

Other Parameters:

Name Type Description
id str

A unique identifier associated with the item.

is_visible bool

If false, this item will be removed from the visual tree.

requires Dict[str, str]

A series of key/value pairs indicating features that the item requires with corresponding minimum version. When a feature is missing or of insufficient version, fallback is triggered.

items List[ElementModel]

The card elements to render inside the Column.

background_image Union[BackgroundImage, str]

Specifies the background image. Acceptable formats are PNG, JPEG, and GIF

bleed bool

Determines whether the column should bleed through its parent's padding.

fallback Column

Describes what to do when an unknown item is encountered or the requires of this or any children can't be met.

min_height str

Specifies the minimum height of the column in pixels, like 80px.

rtl bool

When true content in this column should be presented right to left. When 'false' content in this column should be presented left to right. When unset layout direction will inherit from parent container or column. If unset in all ancestors, the default platform behavior will apply.

separator bool

When true, draw a separating line between this column and the previous column.

spacing Spacing

Controls the amount of spacing between this column and the preceding column.

select_action SelectAction

An Action that will be invoked when the Column is tapped or selected. Action.ShowCard is not supported.

style Style

Style hint for Column.

vertical_content_alignment VerticalAlignment

Defines how the content should be aligned vertically within the column. When not specified, the value of verticalContentAlignment is inherited from the parent container. If no parent container has verticalContentAlignment set, it defaults to Top.

width Union[str, int]

auto, stretch, a number representing relative width of the column in the column group, or in version 1.1 and higher, a specific pixel width, like 50px.

Source code in msadaptivecards/containers.py
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
class Column(CamelModel):
    """
    Defines a container that is part of a ColumnSet.

    Keyword Args:
        id (str):
            A unique identifier associated with the item.
        is_visible (bool):
            If false, this item will be removed from the visual tree.
        requires (Dict[str, str]):
            A series of key/value pairs indicating features that the item requires with corresponding minimum version.
            When a feature is missing or of insufficient version, fallback is triggered.
        items (List[ElementModel]):
            The card elements to render inside the Column.
        background_image (Union[BackgroundImage, str]):
            Specifies the background image. Acceptable formats are PNG, JPEG, and GIF
        bleed (bool):
            Determines whether the column should bleed through its parent's padding.
        fallback (Column):
            Describes what to do when an unknown item is encountered or the requires of this or any children
            can't be met.
        min_height (str):
            Specifies the minimum height of the column in pixels, like `80px`.
        rtl (bool):
            When true content in this column should be presented right to left. When 'false' content in this column
            should be presented left to right. When unset layout direction will inherit from parent
            container or column. If unset in all ancestors, the default platform behavior will apply.
        separator (bool):
            When true, draw a separating line between this column and the previous column.
        spacing (Spacing):
            Controls the amount of spacing between this column and the preceding column.
        select_action (SelectAction):
            An Action that will be invoked when the Column is tapped or selected. Action.ShowCard is not supported.
        style (Style):
            Style hint for Column.
        vertical_content_alignment (VerticalAlignment):
            Defines how the content should be aligned vertically within the column. When not specified, the value of
            verticalContentAlignment is inherited from the parent container. If no parent container has
            verticalContentAlignment set, it defaults to Top.
        width (Union[str, int]):
            `auto`, `stretch`, a number representing relative width of the column in the column group, or in
            version 1.1 and higher, a specific pixel width, like `50px`.
    """

    id: str = Field(None, description="A unique identifier associated with the item.")
    is_visible: bool = Field(True, description="If false, this item will be removed from the visual tree.")
    requires: Dict[str, str] = Field(
        default_factory=dict,
        description="A series of key/value pairs indicating features that the item requires with corresponding "
        "minimum version. When a feature is missing or of insufficient version, fallback is triggered.",
    )
    items: List[ElementModel] = Field(
        default_factory=list, description="The card elements to render inside the Column."
    )
    background_image: Union[BackgroundImage, str] = Field(
        None, description="Specifies the background image. Acceptable formats are PNG, JPEG, and GIF"
    )
    bleed: bool = Field(None, description="Determines whether the column should bleed through its parent's padding.")
    fallback: "Column" = Field(
        None,
        description="Describes what to do when an unknown item is encountered or the "
        "requires of this or any children can't be met.",
    )
    min_height: str = Field(None, description="Specifies the minimum height of the column in pixels, like '80px'.")
    rtl: bool = Field(
        False,
        description="When true content in this column should be presented right to left. When 'false' content in this "
        "column should be presented left to right. When unset layout direction will inherit from parent container or "
        "column. If unset in all ancestors, the default platform behavior will apply.",
    )
    separator: bool = Field(
        None, description="When true, draw a separating line between this column and the previous column."
    )
    spacing: Spacing = Field(
        None, description="Controls the amount of spacing between this column and the preceding column."
    )
    select_action: SelectAction = Field(
        None,
        description="An Action that will be invoked when the Column is tapped or selected. "
        "Action.ShowCard is not supported.",
    )
    style: Style = Field(None, description="Style hint for Column.")
    vertical_content_alignment: VerticalAlignment = Field(
        None,
        description="Defines how the content should be aligned vertically within the column. When not specified, the "
        "value of verticalContentAlignment is inherited from the parent container. If no parent container has "
        "verticalContentAlignment set, it defaults to Top.",
    )
    width: Union[str, int] = Field(
        None,
        description="'auto', 'stretch', a number representing relative width of the column in the column group, or in "
        "version 1.1 and higher, a specific pixel width, like '50px'.",
    )

ColumnSet

Bases: BaseContainers

ColumnSet divides a region into Columns, allowing elements to sit side-by-side.

Other Parameters:

Name Type Description
type str

Must be ColumnSet.

columns List[Column]

The array of Columns to divide the region into.

select_action SelectAction

An Action that will be invoked when the ColumnSet is tapped or selected. Action.ShowCard is not supported.

style Style

Style hint for ColumnSet.

bleed bool

Determines whether the element should bleed through its parent's padding.

min_height str

Specifies the minimum height of the column set in pixels, like 80px.

horizontal_alignment HorizontalAlignment

Controls the horizontal alignment of the ColumnSet. When not specified, the value of horizontalAlignment is inherited from the parent container. If no parent container has horizontalAlignment set, it defaults to Left.

Source code in msadaptivecards/containers.py
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
class ColumnSet(BaseContainers):
    """
    ColumnSet divides a region into Columns, allowing elements to sit side-by-side.

    Keyword Args:
        type (str):
            Must be `ColumnSet`.
        columns (List[Column]):
            The array of Columns to divide the region into.
        select_action (SelectAction):
            An Action that will be invoked when the ColumnSet is tapped or selected. Action.ShowCard is not supported.
        style (Style):
            Style hint for ColumnSet.
        bleed (bool):
            Determines whether the element should bleed through its parent's padding.
        min_height (str):
            Specifies the minimum height of the column set in pixels, like `80px`.
        horizontal_alignment (HorizontalAlignment):
            Controls the horizontal alignment of the ColumnSet. When not specified, the value of horizontalAlignment
            is inherited from the parent container. If no parent container has horizontalAlignment set, it
            defaults to Left.
    """

    type: Literal["ColumnSet"] = Field("ColumnSet", description="Must be 'ColumnSet'.")
    columns: List[Column] = Field(default_factory=list, description="The array of Columns to divide the region into.")
    select_action: SelectAction = Field(
        None,
        description="An Action that will be invoked when the ColumnSet is tapped or selected. Action.ShowCard "
        "is not supported.",
    )
    style: Style = Field(None, description="Style hint for ColumnSet.")
    bleed: bool = Field(None, description="Determines whether the element should bleed through its parent's padding.")
    min_height: str = Field(None, description="Specifies the minimum height of the column set in pixels, like '80px'.")
    horizontal_alignment: HorizontalAlignment = Field(
        None,
        description="Controls the horizontal alignment of the ColumnSet. When not specified, the value of "
        "horizontalAlignment is inherited from the parent container. If no parent container has horizontalAlignment "
        "set, it defaults to Left.",
    )

Container

Bases: BaseContainers

Containers group items together.

Other Parameters:

Name Type Description
type str

Must be Container.

items List[ElementModel]

The card elements to render inside the Container.

select_action SelectAction

An Action that will be invoked when the Container is tapped or selected. Action.ShowCard is not supported.

style Style

Style hint for Container.

vertical_content_alignment VerticalAlignment

Defines how the content should be aligned vertically within the container. When not specified, the value of verticalContentAlignment is inherited from the parent container. If no parent container has verticalContentAlignment set, it defaults to Top.

bleed bool

Determines whether the element should bleed through its parent's padding.

background_image Union[BackgroundImage, str]

Specifies the background image. Acceptable formats are PNG, JPEG, and GIF.

min_height str

Specifies the minimum height of the container in pixels, like 80px.

rtl bool

When true content in this container should be presented right to left. When 'false' content in this container should be presented left to right. When unset layout direction will inherit from parent container or column. If unset in all ancestors, the default platform behavior will apply.

Source code in msadaptivecards/containers.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
class Container(BaseContainers):
    """
    Containers group items together.

    Keyword Args:
        type (str): Must be `Container`.
        items (List[ElementModel]): The card elements to render inside the Container.
        select_action (SelectAction): An Action that will be invoked when the Container is tapped or selected.
            Action.ShowCard is not supported.
        style (Style): Style hint for Container.
        vertical_content_alignment (VerticalAlignment): Defines how the content should be aligned vertically within
            the container. When not specified, the value of verticalContentAlignment is inherited from the parent
            container. If no parent container has verticalContentAlignment set, it defaults to Top.
        bleed (bool): Determines whether the element should bleed through its parent's padding.
        background_image (Union[BackgroundImage, str]): Specifies the background image. Acceptable formats
            are PNG, JPEG, and GIF.
        min_height (str): Specifies the minimum height of the container in pixels, like `80px`.
        rtl (bool): When true content in this container should be presented right to left. When 'false' content in
            this container should be presented left to right. When unset layout direction will inherit from parent
            container or column. If unset in all ancestors, the default platform behavior will apply.
    """

    type: Literal["Container"] = Field("Container", description="Must be 'Container'.")
    items: List[ElementModel] = Field(
        default_factory=list, description="The card elements to render inside the Container."
    )
    select_action: SelectAction = Field(
        None,
        description="An Action that will be invoked when the Container is "
        "tapped or selected. Action.ShowCard is not supported.",
    )
    style: Style = Field(None, description="Style hint for Container.")
    vertical_content_alignment: VerticalAlignment = Field(
        None,
        description="Defines how the content should be aligned "
        "vertically within the container. When not specified, the value of verticalContentAlignment is inherited from "
        "the parent container. If no parent container has verticalContentAlignment set, it defaults to Top.",
    )
    bleed: bool = Field(None, description="Determines whether the element should bleed through its parent's padding.")
    background_image: Union[BackgroundImage, str] = Field(
        None, description="Specifies the background image. Acceptable formats are PNG, JPEG, and GIF"
    )
    min_height: str = Field(None, description="Specifies the minimum height of the container in pixels, like '80px'.")
    rtl: bool = Field(
        False,
        description="When true content in this container should be presented right to left. "
        "When 'false' content in this container should be presented left to right. When unset layout direction will "
        "inherit from parent container or column. If unset in all ancestors, the default platform behavior "
        "will apply.",
    )

Fact

Bases: CamelModel

Describes a Fact in a FactSet as a key/value pair.

Other Parameters:

Name Type Description
title str

The title of the fact.

value str

The value of the fact.

Source code in msadaptivecards/containers.py
345
346
347
348
349
350
351
352
353
354
355
356
357
class Fact(CamelModel):
    """
    Describes a Fact in a FactSet as a key/value pair.

    Keyword Args:
        title (str):
            The title of the fact.
        value (str):
            The value of the fact.
    """

    title: str = Field(..., description="The title of the fact.")
    value: str = Field(..., description="The value of the fact.")

FactSet

Bases: BaseContainers

The FactSet element displays a series of facts (i.e. name/value pairs) in a tabular form.

Other Parameters:

Name Type Description
type str

Must be FactSet.

facts List[Fact]

The array of Fact's.

Source code in msadaptivecards/containers.py
360
361
362
363
364
365
366
367
368
369
370
371
372
class FactSet(BaseContainers):
    """
    The FactSet element displays a series of facts (i.e. name/value pairs) in a tabular form.

    Keyword Args:
        type (str):
            Must be `FactSet`.
        facts (List[Fact]):
            The array of Fact's.
    """

    type: Literal["FactSet"] = Field("FactSet", description="Must be FactSet.")
    facts: List[Fact] = Field(default_factory=list, description="The array of Fact's.")

Table

Bases: BaseContainers

Provides a way to display data in a tabular form.

Other Parameters:

Name Type Description
type str

Must be Table.

columns List[TableColumnDefinition]

Defines the number of columns in the table, their sizes, and more.

rows List[TableRow]

Defines the rows of the table.

first_row_as_header bool

Specifies whether the first row of the table should be treated as a header row, and be announced as such by accessibility software.

show_grid_lines bool

Specifies whether grid lines should be displayed.

grid_style Style

Defines the style of the grid. This property currently only controls the grid's color.

horizontal_cell_content_alignment HorizontalAlignment

Controls how the content of all cells is horizontally aligned by default. When not specified, horizontal alignment is defined on a per-cell basis.

vertical_cell_content_alignment VerticalAlignment

Controls how the content of all cells is vertically aligned by default. When not specified, vertical alignment is defined on a per-cell basis.

Source code in msadaptivecards/containers.py
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
class Table(BaseContainers):
    """
    Provides a way to display data in a tabular form.

    Keyword Args:
        type (str):
            Must be Table.
        columns (List[TableColumnDefinition]):
            Defines the number of columns in the table, their sizes, and more.
        rows (List[TableRow]):
            Defines the rows of the table.
        first_row_as_header (bool):
            Specifies whether the first row of the table should be treated as a header row, and be announced as such
            by accessibility software.
        show_grid_lines (bool):
            Specifies whether grid lines should be displayed.
        grid_style (Style):
            Defines the style of the grid. This property currently only controls the grid's color.
        horizontal_cell_content_alignment (HorizontalAlignment):
            Controls how the content of all cells is horizontally aligned by default. When not specified, horizontal
            alignment is defined on a per-cell basis.
        vertical_cell_content_alignment (VerticalAlignment):
            Controls how the content of all cells is vertically aligned by default. When not specified, vertical
            alignment is defined on a per-cell basis.
    """

    type: Literal["Table"] = Field("Table", description="Must be Table.")
    columns: List[TableColumnDefinition] = Field(
        default_factory=list, description="Defines the number of columns in the table, their sizes, and more."
    )
    rows: List[TableRow] = Field(default_factory=list, description="Defines the rows of the table.")
    first_row_as_header: bool = Field(
        True,
        description="Specifies whether the first row of the table should be treated as a header row, and be announced "
        "as such by accessibility software.",
    )
    show_grid_lines: bool = Field(True, description="Specifies whether grid lines should be displayed.")
    grid_style: Style = Field(
        None, description="Defines the style of the grid. This property currently only controls the grid's color."
    )
    horizontal_cell_content_alignment: HorizontalAlignment = Field(
        None,
        description="Controls how the content of all cells is horizontally aligned by default. When not specified, "
        "horizontal alignment is defined on a per-cell basis.",
    )
    vertical_cell_content_alignment: VerticalAlignment = Field(
        None,
        description="Controls how the content of all cells is vertically aligned by default. When not specified, "
        "vertical alignment is defined on a per-cell basis.",
    )

TableCell

Bases: BaseContainers

Represents a cell within a row of a Table element.

Other Parameters:

Name Type Description
type str

Must be TableCell.

items List[ElementModel]

The card elements to render inside the TableCell.

select_action SelectAction

An Action that will be invoked when the TableCell is tapped or selected. Action.ShowCard is not supported.

style Style

Style hint for TableCell.

vertical_content_alignment VerticalAlignment

Defines how the content should be aligned vertically within the container. When not specified, the value of vertical_content_alignment is inherited from the parent container. If no parent container has vertical_content_alignment set, it defaults to Top.

bleed bool

Determines whether the element should bleed through its parent's padding.

background_image BackgroundImage

Specifies the background image. Acceptable formats are PNG, JPEG, and GIF

min_height str

Specifies the minimum height of the container in pixels, like 80px.

rtl bool

When true content in this container should be presented right to left. When False content in this container should be presented left to right. When unset layout direction will inherit from parent container or column. If unset in all ancestors, the default platform behavior will apply.

Source code in msadaptivecards/containers.py
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
class TableCell(BaseContainers):
    """
    Represents a cell within a row of a Table element.

    Keyword Args:
        type (str):
            Must be `TableCell`.
        items (List[ElementModel]):
            The card elements to render inside the TableCell.
        select_action (SelectAction):
            An Action that will be invoked when the TableCell is tapped or selected. Action.ShowCard is not supported.
        style (Style):
            Style hint for TableCell.
        vertical_content_alignment (VerticalAlignment):
            Defines how the content should be aligned vertically within the container. When not specified, the value
            of vertical_content_alignment is inherited from the parent container. If no parent container has
            vertical_content_alignment set, it defaults to Top.
        bleed (bool):
            Determines whether the element should bleed through its parent's padding.
        background_image (BackgroundImage):
            Specifies the background image. Acceptable formats are PNG, JPEG, and GIF
        min_height (str):
            Specifies the minimum height of the container in pixels, like `80px`.
        rtl (bool):
            When true content in this container should be presented right to left. When `False` content in this
            container should be presented left to right. When unset layout direction will inherit from parent
            container or column. If unset in all ancestors, the default platform behavior will apply.
    """

    type: Literal["TableCell"] = Field("TableCell", description="Must be TableCell.")
    items: List[ElementModel] = Field(
        default_factory=list, description="The card elements to render inside the TableCell."
    )
    select_action: SelectAction = Field(
        None,
        description="An Action that will be invoked when the TableCell is tapped or selected. Action.ShowCard "
        "is not supported.",
    )
    style: Style = Field(None, description="Style hint for TableCell.")
    vertical_content_alignment: VerticalAlignment = Field(
        None,
        description="Defines how the content should be aligned vertically within the container. When not specified, "
        "the value of verticalContentAlignment is inherited from the parent container. If no parent container has "
        "verticalContentAlignment set, it defaults to Top.",
    )
    bleed: bool = Field(None, description="Determines whether the element should bleed through its parent's padding.")
    background_image: BackgroundImage = Field(
        None, description="Specifies the background image. Acceptable formats are PNG, JPEG, and GIF"
    )
    min_height: str = Field(None, description="Specifies the minimum height of the container in pixels, like '80px'.")
    rtl: bool = Field(
        False,
        description="When true content in this container should be presented right to left. When 'false' content in "
        "this container should be presented left to right. When unset layout direction will inherit from parent "
        "container or column. If unset in all ancestors, the default platform behavior will apply.",
    )

TableColumnDefinition

Bases: BaseModel

Used to define the table and how large the columns should be.

Other Parameters:

Name Type Description
width str

How wide should the column be, can be as column numbers or pixels.

Source code in msadaptivecards/containers.py
208
209
210
211
212
213
214
215
216
217
class TableColumnDefinition(BaseModel):
    """
    Used to define the table and how large the columns should be.

    Keyword Args:
        width (str):
            How wide should the column be, can be as column numbers or pixels.
    """

    width: str = Field("1", description="How wide should the column be, can be as column numbers or pixels.")

TableRow

Bases: BaseModel

Represents an table row.

Other Parameters:

Name Type Description
type str

Must be TableRow.

cells List[TableCell]

Collection of table cell configurations.

Source code in msadaptivecards/containers.py
278
279
280
281
282
283
284
285
286
287
288
289
290
class TableRow(BaseModel):
    """
    Represents an table row.

    Keyword Args:
        type (str):
            Must be `TableRow`.
        cells (List[TableCell]):
            Collection of table cell configurations.
    """

    type: Literal["TableRow"] = Field("TableRow", description="Must be TableRow.")
    cells: List[TableCell] = Field(default_factory=list, description="Collection of table cell configurations.")

Last update: 2022-08-16