# UIGridContainerElementUpdate

***

The parameters for updating a grid container element.

See [UIGridContainerElement](/js-sdk-api-reference/ui/uigridcontainerelement.md) for more details.

## Remarks

`id` and `type` are required to identify the element to update.

## Properties

### type

> **type**: `"Grid"`

***

### id

> **id**: `string`

The ID of the element.

***

### grid?

> `optional` **grid**: `string`

The grid to use for the container. It is the exact same as CSS's shorthand property `grid`.

#### Example

#### horizontal stack

two columns, the first column is 50px wide, the second column takes the remaining space

```typescript
{
  type: "Grid",
  grid: "auto-flow / 50px 1fr",
  items: [...]
}
```

#### See

<https://developer.mozilla.org/en-US/docs/Web/CSS/grid> for more details.

***

### verticalAlignment?

> `optional` **verticalAlignment**: `"center"` | `"top"` | `"bottom"`

The alignment of the items in the grid. Only takes effect on horizontal stacks.

#### Default Value

`"top"`

***

### horizontalDistribution?

> `optional` **horizontalDistribution**: `"center"` | `"start"` | `"end"` | `"space-between"` | `"space-around"` | `"space-evenly"`

The distribution of the items in the grid. Only takes effect on horizontal stacks.

#### Default Value

`"start"`

***

### items?

> `optional` **items**: ([`UIButtonElementCreate`](/js-sdk-api-reference/ui/uibuttonelementcreate.md) | [`UITextElementCreate`](/js-sdk-api-reference/ui/uitextelementcreate.md) | [`UIDividerElementCreate`](/js-sdk-api-reference/ui/uidividerelementcreate.md) | [`UITextInputElementCreate`](/js-sdk-api-reference/ui/uitextinputelementcreate.md) | [`UISelectElementCreate`](/js-sdk-api-reference/ui/uiselectelementcreate.md) | [`UIFlexibleSpaceElementCreate`](/js-sdk-api-reference/ui/uiflexiblespaceelementcreate.md) | [`UIButtonRowElementCreate`](/js-sdk-api-reference/ui/uibuttonrowelementcreate.md) | [`UICheckboxGroupElementCreate`](/js-sdk-api-reference/ui/uicheckboxgroupelementcreate.md) | [`UIRadioGroupElementCreate`](/js-sdk-api-reference/ui/uiradiogroupelementcreate.md) | [`UIToggleGroupElementCreate`](/js-sdk-api-reference/ui/uitogglegroupelementcreate.md) | [`UIIframeElementCreate`](/js-sdk-api-reference/ui/uiiframeelementcreate.md))\[]

The items to add to the grid container.

***

### onCreate()?

> `optional` **onCreate**: (`args`: { `id`: `string`; }) => `void`

A function to call when the element is created.

#### Parameters

| Parameter | Type                | Description                           |
| --------- | ------------------- | ------------------------------------- |
| `args`    | { `id`: `string`; } | The arguments passed to the function. |
| `args.id` | `string`            | The id of the element.                |

#### Returns

`void`

***

### onDestroy()?

> `optional` **onDestroy**: (`args`: { `id`: `string`; }) => `void`

A function to call when the element is destroyed.

#### Parameters

| Parameter | Type                | Description                           |
| --------- | ------------------- | ------------------------------------- |
| `args`    | { `id`: `string`; } | The arguments passed to the function. |
| `args.id` | `string`            | The id of the element.                |

#### Returns

`void`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.felt.com/js-sdk-api-reference/ui/uigridcontainerelementupdate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
