# lvgl.rectangle

## Syntax

lvgl.rectangle(\[parent], {settings})

parent:rectangle({settings})

## Parameters

See the API page for parameter description and common settings.

Rectangle are based on the 'lvgl.box' object so all of the settings from 'lvgl.box' also apply.

Rectangle specific settings:

<table><thead><tr><th width="120">Name</th><th width="126">Type</th><th width="335">Description</th><th>Default if not set</th></tr></thead><tbody><tr><td>thickness</td><td>Number</td><td>Sets the width of the line used to draw the border.</td><td>1</td></tr><tr><td>filled</td><td>Boolean or Function</td><td>If true the rectangle is filled with the 'color' value.<br><br>Filled can be a function in 2.11.4 or later.</td><td>false</td></tr><tr><td>rounded</td><td>Number</td><td>If greater than 0 makes the corners rounded with a radius set this value.<br>When set to a value greater than 0, must also be >= thickness.</td><td>0</td></tr><tr><td>opacity</td><td>Number or Function</td><td>Sets the opacity.<br>Note: range is 0 (transparent) to 255 (opaque)</td><td>255 (opaque)</td></tr></tbody></table>

## Notes

When used in a stand alone tool script, the rectangle will automatically add scroll bars if any child objects are placed outside of the rectangle boundaries. For widgtes, child objects outside the rectangle bounds will be clipped.

## Return values

LVGL object

## API Status

<table><thead><tr><th width="153"></th><th width="72" data-type="checkbox">Avail</th><th width="145">Status<select><option value="93c8b010d44e45efaec5c0c14d3992ac" label="active" color="blue"></option><option value="7e7074d1164048e3b0b24a02b4300f6c" label="to be depreciated" color="blue"></option></select></th><th>Comment</th></tr></thead><tbody><tr><td>BW radios</td><td>false</td><td></td><td></td></tr><tr><td>Color radios</td><td>true</td><td><span data-option="93c8b010d44e45efaec5c0c14d3992ac">active</span></td><td></td></tr></tbody></table>

## Change log

<table><thead><tr><th width="177">EdgeTX version</th><th>Change</th></tr></thead><tbody><tr><td>2.11.0</td><td>Introduced</td></tr></tbody></table>


---

# 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://luadoc.edgetx.org/lua-api-reference/lvgl-for-lua/lvgl.rectangle.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.
