# Rect

The `<rect>` can be used to display a rectangle in a certain color.

It can be used both within [`<body>`](/document-xml-adx/adx-elements/body.md) and [`<template>`](/document-xml-adx/adx-elements/template.md).

## Examples

```xml
<template ...>
  <rect
    bottom="247mm"
    left="0"
    width="210mm"
    height="50mm"
    color="rgb(255, 10, 10)"
  />
</template>
```

```xml
<body ...>
  ...
  <rect
    width="100%"
    height="2cm"
    border="2"
    borderColor="red"
    spaceBefore="10"
    spaceAfter="20"
  />
</template>
```

## Attributes

#### `width`

The width of the rectangle. Can be in pt, mm, cm, or `%` (e.g. `width="100%"` when used in `<body>`).

#### `height`

The height of the rectangle. Can be in pt, mm, or cm.

#### `left`

Only used in `<template>` context. The distance from the left border of the document, in pt, mm, or cm.

#### `bottom`

Only used in `<template>` context. The distance from the bottom border of the document, in pt, mm, or cm.

#### `color` (optional)

The fill color of the rectangle. Can be a named color (e.g. `red`) or an RGB value (e.g. `rgb(255, 10, 10)`).

#### `border` (optional)

The width of the border in pt.

#### `borderColor` (optional)

The color of the border. Required together with `border` for the border to be drawn.

#### `class` (optional)

The style class to apply to the rectangle.

#### `spaceBefore` (optional)

Space before the rectangle in pt, mm or cm. Only applies in `<body>` context.

#### `spaceAfter` (optional)

Space after the rectangle in pt, mm or cm. Only applies in `<body>` context.

<details>

<summary></summary>

</details>


---

# 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://docs.atfinity.io/document-xml-adx/adx-elements/rect.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.
