---
title: "Rectangle Image API — Cards, panels & badges | Imejis"
description: "Draw filled rectangles with rounding, borders and shadows as cards, panels and backdrops — recolored on every API call. Start building image layouts free."
url: "https://www.imejis.io/components/rect"
---

# Rectangle Image API — Cards, panels & badges | Imejis

A filled rectangle with borders, rounding, opacity and shadows — the building block for cards, panels, badges and backgrounds.

## Use cases

- Card backdrops behind dynamic text and photos
- Status badges recolored by state per render
- Section panels for OG image layouts

## Authoring notes

- Also how you draw lines and dividers: a thin rect (component type "line" renders identically).

## Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `fillColor` | `color` | `"#808080"` | Fill color. |
| `opacity` | `number` | `1` | Overall component opacity from 0 (transparent) to 1 (opaque). |
| `borderWidth` | `number` | `0` | Border thickness in pixels around the component. |
| `borderColor` | `color` | `"transparent"` | Border color (any CSS color). |
| `borderStyle` | `'solid' \| 'dashed' \| 'dotted' \| 'double' \| 'none'` | `"solid"` | Border line style. |
| `borderRadius` | `number` | `0` | Corner radius in pixels. |
| `boxShadow` | `string` | — | CSS box-shadow applied to the component, e.g. "0 4px 6px rgba(0,0,0,0.1)". |

## Sample design JSON

```json
{
  "title": "Rectangle sample",
  "description": "A rounded dynamic panel",
  "dimensions": {
    "width": 800,
    "height": 420
  },
  "background": {
    "color": "#ffffff"
  },
  "components": [
    {
      "id": "sample-rect",
      "key": "panel",
      "type": "rect",
      "position": {
        "x": 220,
        "y": 110
      },
      "rotation": 0,
      "size": {
        "width": 360,
        "height": 200
      },
      "dynamic": true,
      "properties": {
        "fillColor": "#4F46E5",
        "borderRadius": 16,
        "opacity": 1
      }
    }
  ]
}
```

## Examples

### Deploy-succeeded toast panel

A green rounded panel serving as the backdrop of a "Deploy succeeded" notification card.

API overrides that reproduce this example:

```json
{
  "panel.fillColor": "#10B981",
  "panel.borderRadius": 12,
  "panel.boxShadow": "0 8px 20px rgba(16,185,129,0.35)"
}
```

### Dark hero backdrop

A near-full-canvas navy panel laid behind an imagined OG-image headline and logo.

API overrides that reproduce this example:

```json
{
  "panel.fillColor": "#0F172A",
  "panel.borderRadius": 24
}
```

## API overrides

Recolor per render with '<key>.fillColor' (or just '<key>'); opacity and borderColor are overridable too.

Flat override payload (`key.property` addressing) with the sample design's current values — send only the keys you want to change:

```json
{
  "panel.fillColor": "#4F46E5",
  "panel.borderRadius": 16,
  "panel.opacity": 1
}
```

```bash
curl --location 'https://render.imejis.io/v1/{{YOUR_DESIGN_ID}}' \
--header 'dma-api-key: {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
    "panel.fillColor": "#4F46E5",
    "panel.borderRadius": 16,
    "panel.opacity": 1
}'
```

`{{YOUR_DESIGN_ID}}` and `{{YOUR_API_KEY}}` are placeholders: first create
the design in your account (paste the sample design JSON above into the
editor at https://app.imejis.io, or create it programmatically via the
imejis MCP server's `create_design` + `update_design` tools), then render
it with the design's id and one of your API keys.

Agents: the MCP server at https://api.imejis.io/api/mcp exposes this same
catalog as structured data via the `list_component_types` tool (property
kinds, allowed values, bounds, ready-to-use sample designs).

## Frequently Asked Questions

### Can I change the color per API call?

Yes — '<key>.fillColor' (or just the key) recolors the rectangle per render; opacity and border properties are overridable too.

### Can I make rounded cards and pills?

borderRadius rounds the corners — push it high for a fully-rounded pill — and borders and box shadows finish the card look.

### What is the rectangle typically used for?

It is the layout building block: cards, panels, badges, overlays and backgrounds layered behind text, images and charts.

## Variants

- [Outlined card](https://www.imejis.io/components/rect/outlined-card.md) — White card with a subtle border and shadow — content containers.
- [Pill badge](https://www.imejis.io/components/rect/pill-badge.md) — Fully-rounded small bar — badges, tags and labels.

All components: https://www.imejis.io/components.md
