# lv_layout.h (/api/layouts/lv_layout_h)



<RelatedHeaders name="lv_layout_private.h" isPrivate="false" />

<ApiSummary functions="2" enums="1" structs="1" typedefs="2" />

Functions [#functions]

<ApiMember kind="function" name="lv_layout_create" file="layouts/lv_layout.h" line="57" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/layouts/lv_layout.h#L57">
  lv_layout_create [#lv_layout_create]

  Create a new layout

  ```c title=" " lineNumbers=1
  uint32_t lv_layout_create(lv_layout_callbacks_t callbacks, void *user_data)
  ```

  <span className="sr-only">
    Parameters
  </span>

  | Name        | Type                                     | Description                                                |
  | ----------- | ---------------------------------------- | ---------------------------------------------------------- |
  | `callbacks` | <ApiLink name="lv_layout_callbacks_t" /> | the layout callbacks                                       |
  | `user_data` | `void *`                                 | custom data that will be passed when a callback is invoked |

  **Returns:** <ApiLink name="uint32_t" /> — the ID of the new layout
</ApiMember>

<ApiMember kind="function" name="lv_layout_register" file="layouts/lv_layout.h" line="67" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/layouts/lv_layout.h#L67">
  lv_layout_register [#lv_layout_register]

  DEPRECATED: `lv_layout_register` is deprecated. `lv_layout_create` should be used instead.

  Register a new layout

  ```c title=" " lineNumbers=1
  uint32_t lv_layout_register(lv_layout_update_cb_t cb, void *user_data)
  ```

  <span className="sr-only">
    Parameters
  </span>

  | Name        | Type                                     | Description                             |
  | ----------- | ---------------------------------------- | --------------------------------------- |
  | `cb`        | <ApiLink name="lv_layout_update_cb_t" /> | the layout update callback              |
  | `user_data` | `void *`                                 | custom data that will be passed to `cb` |

  **Returns:** <ApiLink name="uint32_t" /> — the ID of the new layout
</ApiMember>

Enums [#enums]

<ApiMember kind="enum" name="lv_layout_t" file="layouts/lv_layout.h" line="36" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/layouts/lv_layout.h#L36">
  lv_layout_t [#lv_layout_t]

  | Name             | Value |
  | ---------------- | ----- |
  | `LV_LAYOUT_NONE` | `0`   |
  | `LV_LAYOUT_FLEX` |       |
  | `LV_LAYOUT_GRID` |       |
  | `LV_LAYOUT_LAST` |       |
</ApiMember>

Structs [#structs]

<ApiMember kind="struct" name="lv_layout_callbacks_t">
  lv_layout_callbacks_t [#lv_layout_callbacks_t]

  | Member             | Type                                           | Description |
  | ------------------ | ---------------------------------------------- | ----------- |
  | `layout_update_cb` | <ApiLink name="lv_layout_update_cb_t" />       |             |
  | `get_min_size_cb`  | <ApiLink name="lv_layout_get_min_size_cb_t" /> |             |
</ApiMember>

<TypeUsedBy name="lv_layout_callbacks_t" count="1">
  * `lv_layout_create` — param `callbacks`
</TypeUsedBy>

Typedefs [#typedefs]

<ApiMember kind="typedef" name="lv_layout_update_cb_t" file="layouts/lv_layout.h" line="27" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/layouts/lv_layout.h#L27">
  lv_layout_update_cb_t [#lv_layout_update_cb_t]

  ```c title=" " lineNumbers=1
  typedef void(* lv_layout_update_cb_t) (lv_obj_t *, void *user_data)
  ```
</ApiMember>

<TypeUsedBy name="lv_layout_update_cb_t" count="1">
  * `lv_layout_register` — param `cb`
</TypeUsedBy>

<ApiMember kind="typedef" name="lv_layout_get_min_size_cb_t" file="layouts/lv_layout.h" line="28" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/layouts/lv_layout.h#L28">
  lv_layout_get_min_size_cb_t [#lv_layout_get_min_size_cb_t]

  ```c title=" " lineNumbers=1
  typedef bool(* lv_layout_get_min_size_cb_t) (lv_obj_t *, int32_t *req_size, bool width, void *user_data)
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_types.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_grid.h&#x22;]" includedBy="[&#x22;lv_global.h&#x22;, &#x22;lv_layout_private.h&#x22;, &#x22;lv_style.h&#x22;]" transitiveIncludes="[&#x22;lv_area.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_math.h&#x22;]" />
