# lv_layout.h (/api/public/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="public/layouts/lv_layout.h" line="57" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/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 **May** be `NULL`. |

  **Returns:** `uint32_t` — the ID of the new layout
</ApiMember>

<ApiMember kind="function" name="lv_layout_register" file="public/layouts/lv_layout.h" line="69" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/layouts/lv_layout.h#L69">
  lv_layout_register [#lv_layout_register]

  Register a new layout

  \> &#x2A;*Deprecated:** use `lv_layout_create` instead.

  ```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` **May** be `NULL`. |

  **Returns:** `uint32_t` — the ID of the new layout
</ApiMember>

Enums [#enums]

<ApiMember kind="enum" name="lv_layout_t" file="public/layouts/lv_layout.h" line="36" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/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="public/layouts/lv_layout.h" line="27" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/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="public/layouts/lv_layout.h" line="28" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/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_style.h&#x22;, &#x22;lvgl.h&#x22;]" transitiveIncludes="[&#x22;lv_area.h&#x22;, &#x22;lv_math.h&#x22;]" />
