---
title: "Heart Shape Image API — Heart vectors via API | Imejis"
description: "A ready heart path for likes, favorites and love-themed visuals, recolored on every API call. Add heart shapes to generated images free with Imejis."
url: "https://www.imejis.io/components/shape/heart"
---

# Heart Shape Image API — Heart vectors via API | Imejis

A heart path — likes, favorites and love-themed visuals.

## Use cases

- Like and favorite milestone graphics
- Valentine campaign visuals
- Health and wellness imagery

## Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `path` | `string` | `"M 10 10 L 90 90"` | SVG path data drawn inside the viewBox. |
| `viewBox` | `string` | `"0 0 100 100"` | SVG viewBox the path coordinates are relative to. |
| `fillColor` | `color` | `"#808080"` | Fill color. |
| `strokeColor` | `color` | `"transparent"` | Stroke (outline) color. |
| `strokeWidth` | `number` (min 0) | `0` | Stroke width in viewBox units. |
| `preserveAspectRatio` | `string` | `"xMidYMid meet"` | SVG preserveAspectRatio value controlling how the path scales. |
| `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)". |

## Design JSON (this variant)

```json
{
  "title": "Shape sample",
  "description": "A dynamic star shape",
  "dimensions": {
    "width": 800,
    "height": 420
  },
  "background": {
    "color": "#ffffff"
  },
  "components": [
    {
      "id": "sample-shape",
      "key": "star",
      "type": "shape",
      "position": {
        "x": 290,
        "y": 100
      },
      "rotation": 0,
      "size": {
        "width": 220,
        "height": 220
      },
      "dynamic": true,
      "properties": {
        "path": "M 50 88 C 22 66 6 48 6 30 C 6 15 17 6 29 6 C 38 6 46 11 50 19 C 54 11 62 6 71 6 C 83 6 94 15 94 30 C 94 48 78 66 50 88 Z",
        "viewBox": "0 0 100 100",
        "fillColor": "#EF4444",
        "strokeColor": "transparent",
        "strokeWidth": 0,
        "opacity": 1
      }
    }
  ]
}
```

## Examples

### Like milestone badge

A pink heart for a "10K likes" celebration graphic posted when a milestone is hit.

API overrides that reproduce this example:

```json
{
  "star.path": "M 50 88 C 22 66 6 48 6 30 C 6 15 17 6 29 6 C 38 6 46 11 50 19 C 54 11 62 6 71 6 C 83 6 94 15 94 30 C 94 48 78 66 50 88 Z",
  "star.fillColor": "#EC4899",
  "star.strokeColor": "transparent"
}
```

### Wellness heart on dark

A soft coral heart as the focal mark of a dark health-app weekly summary image.

API overrides that reproduce this example:

```json
{
  "star.path": "M 50 88 C 22 66 6 48 6 30 C 6 15 17 6 29 6 C 38 6 46 11 50 19 C 54 11 62 6 71 6 C 83 6 94 15 94 30 C 94 48 78 66 50 88 Z",
  "star.fillColor": "#F87171",
  "star.strokeColor": "transparent"
}
```

## API overrides

Recolor per render with '<key>.fillColor' (or just '<key>'); strokeColor, strokeWidth and even the path are overridable.

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

```json
{
  "star.path": "M 50 5 L 61 38 L 95 38 L 68 59 L 79 92 L 50 70 L 21 92 L 32 59 L 5 38 L 39 38 Z",
  "star.viewBox": "0 0 100 100",
  "star.fillColor": "#F5A623",
  "star.strokeColor": "#D0021B",
  "star.strokeWidth": 0,
  "star.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 '{
    "star.path": "M 50 5 L 61 38 L 95 38 L 68 59 L 79 92 L 50 70 L 21 92 L 32 59 L 5 38 L 39 38 Z",
    "star.viewBox": "0 0 100 100",
    "star.fillColor": "#F5A623",
    "star.strokeColor": "#D0021B",
    "star.strokeWidth": 0,
    "star.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).

## Related

- [Shapes component](https://www.imejis.io/components/shape.md) — full reference and FAQs
- [Arrow](https://www.imejis.io/components/shape/arrow.md) — A right-pointing arrow — CTAs and flow diagrams.
- [Outlined](https://www.imejis.io/components/shape/outlined.md) — Stroke-only rendering of the path with a transparent fill.
