> For the complete documentation index, see [llms.txt](https://docs.kivy.fun/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kivy.fun/getting-started/layouts.md).

# Layouts

Layouts are containers used to arrange widgets in a particular manner.

> `AnchorLayout <kivy.uix.anchorlayout>`:\
> Widgets can be anchored to the 'top', 'bottom', 'left', 'right' or 'center'.
>
> `BoxLayout <kivy.uix.boxlayout>`:\
> Widgets are arranged sequentially, in either a 'vertical' or a 'horizontal' orientation.
>
> `FloatLayout <kivy.uix.floatlayout>`:\
> Widgets are essentially unrestricted.
>
> `RelativeLayout <kivy.uix.relativelayout>`:\
> Child widgets are positioned relative to the layout.
>
> `GridLayout <kivy.uix.gridlayout>`:\
> Widgets are arranged in a grid defined by the rows and cols properties.
>
> `PageLayout <kivy.uix.pagelayout>`:\
> Used to create simple multi-page layouts, in a way that allows easy flipping from one page to another using borders.
>
> `ScatterLayout <kivy.uix.scatterlayout>`:\
> Widgets are positioned similarly to a RelativeLayout, but they can be translated, rotate and scaled.
>
> `StackLayout <kivy.uix.stacklayout>`:\
> Widgets are stacked in a lr-tb (left to right then top to bottom) or tb-lr order.

When you add a widget to a layout, the following properties are used to determine the widget's size and position, depending on the type of layout:

> **size\_hint**: defines the size of a widget as a fraction of the parents size. Values are restricted to the range 0.0 - 1.0 i.e. 0.01 = 1/100th of the parent size (1%) and 1. = same size (100%).
>
> **pos\_hint**: is used to place the widget relative to the parent.

The **size\_hint** and **pos\_hint** are used to calculate a widget's size and position only if the value(s) are not set to `None`. If you set these values to `None`, the layout will not position/size the widget and you can specify the values (x, y, width, height) directly in screen coordinates.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.kivy.fun/getting-started/layouts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
