Reference documentation and code samples for the Google Apps Chat V1 Client class Grid.
Displays a grid with a collection of items. Items can only include text or
images. For responsive columns, or to include more than text or images, useColumns. For an example in Google Chat apps,
seeDisplay a Grid with a collection of
items.
A grid supports any number of columns and items. The number of rows is
determined by items divided by columns. A grid with
10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns
has 6 rows.Google Workspace Add-ons and Chat
apps:
For example, the following JSON creates a 2 column grid with a single
item:
The number of columns to display in the grid. A default value is used if this field isn't specified, and that default value is different depending on where the grid is shown (dialog versus companion).
The number of columns to display in the grid. A default value
is used if this field isn't specified, and that default value is
different depending on where the grid is shown (dialog versus companion).
Returns
Type
Description
int
setColumnCount
The number of columns to display in the grid. A default value
is used if this field isn't specified, and that default value is
different depending on where the grid is shown (dialog versus companion).
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getOnClick
This callback is reused by each individual grid item, but with the
item's identifier and index in the items list added to the callback's
parameters.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Apps Chat V1 Client - Class Grid (0.12.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.12.0 (latest)](/php/docs/reference/apps-chat/latest/Card.V1.Grid)\n- [0.11.2](/php/docs/reference/apps-chat/0.11.2/Card.V1.Grid)\n- [0.10.0](/php/docs/reference/apps-chat/0.10.0/Card.V1.Grid)\n- [0.9.0](/php/docs/reference/apps-chat/0.9.0/Card.V1.Grid)\n- [0.8.1](/php/docs/reference/apps-chat/0.8.1/Card.V1.Grid)\n- [0.7.2](/php/docs/reference/apps-chat/0.7.2/Card.V1.Grid)\n- [0.6.1](/php/docs/reference/apps-chat/0.6.1/Card.V1.Grid)\n- [0.5.0](/php/docs/reference/apps-chat/0.5.0/Card.V1.Grid)\n- [0.4.0](/php/docs/reference/apps-chat/0.4.0/Card.V1.Grid)\n- [0.3.0](/php/docs/reference/apps-chat/0.3.0/Card.V1.Grid)\n- [0.2.0](/php/docs/reference/apps-chat/0.2.0/Card.V1.Grid)\n- [0.1.4](/php/docs/reference/apps-chat/0.1.4/Card.V1.Grid) \nReference documentation and code samples for the Google Apps Chat V1 Client class Grid.\n\nDisplays a grid with a collection of items. Items can only include text or\nimages. For responsive columns, or to include more than text or images, use\n[`Columns`](/php/docs/reference/apps-chat/latest/Card.V1.Columns). For an example in Google Chat apps,\nsee [Display a Grid with a collection of\nitems](https://developers.google.com/workspace/chat/format-structure-card-dialog#display_a_grid_with_a_collection_of_items).\n\nA grid supports any number of columns and items. The number of rows is\ndetermined by items divided by columns. A grid with\n10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns\nhas 6 rows.\n[Google Workspace Add-ons and Chat\napps](https://developers.google.com/workspace/extend):\nFor example, the following JSON creates a 2 column grid with a single\nitem: \n\n \"grid\": {\n \"title\": \"A fine collection of items\",\n \"columnCount\": 2,\n \"borderStyle\": {\n \"type\": \"STROKE\",\n \"cornerRadius\": 4\n },\n \"items\": [\n {\n \"image\": {\n \"imageUri\": \"https://www.example.com/image.png\",\n \"cropStyle\": {\n \"type\": \"SQUARE\"\n },\n \"borderStyle\": {\n \"type\": \"STROKE\"\n }\n },\n \"title\": \"An item\",\n \"textAlignment\": \"CENTER\"\n }\n ],\n \"onClick\": {\n \"openLink\": {\n \"url\": \"https://www.example.com\"\n }\n }\n }\n\nGenerated from protobuf message `google.apps.card.v1.Grid`\n\nNamespace\n---------\n\nGoogle \\\\ Apps \\\\ Card \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getTitle\n\nThe text that displays in the grid header.\n\n### setTitle\n\nThe text that displays in the grid header.\n\n### getItems\n\nThe items to display in the grid.\n\n### setItems\n\nThe items to display in the grid.\n\n### getBorderStyle\n\nThe border style to apply to each grid item.\n\n### hasBorderStyle\n\n### clearBorderStyle\n\n### setBorderStyle\n\nThe border style to apply to each grid item.\n\n### getColumnCount\n\nThe number of columns to display in the grid. A default value\nis used if this field isn't specified, and that default value is\ndifferent depending on where the grid is shown (dialog versus companion).\n\n### setColumnCount\n\nThe number of columns to display in the grid. A default value\nis used if this field isn't specified, and that default value is\ndifferent depending on where the grid is shown (dialog versus companion).\n\n### getOnClick\n\nThis callback is reused by each individual grid item, but with the\nitem's identifier and index in the items list added to the callback's\nparameters.\n\n### hasOnClick\n\n### clearOnClick\n\n### setOnClick\n\nThis callback is reused by each individual grid item, but with the\nitem's identifier and index in the items list added to the callback's\nparameters."]]