---
title: "node.add: Create layer — Design kit command — Kition"
description: "Creates a layer of a type (rectangle, ellipse, polygon, star, line, arrow, vector, text, frame, section, component, slice) at x, y in a parent with properties; answers its id."
canonical: "https://developer.kition.ai/docs/kits/design/commands/node.add"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/design/commands/node.add](https://developer.kition.ai/docs/kits/design/commands/node.add)

# node.add

**Create layer.** Creates a layer of a type (rectangle, ellipse, polygon, star, line, arrow, vector, text, frame, section, component, slice) at x, y in a parent with properties; answers its id.

- Kit: Design 0.1.0 (.kdesign); reference: [Design kit commands](https://developer.kition.ai/docs/kits/design.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `characters` | `string` | no |  |
| `closed` | `boolean` | no | vector points: a closed shape |
| `height` | `number` | no |  |
| `index` | `integer` | no | a position counted from 0 (the first is 0) |
| `name` | `string` | no |  |
| `parent` | `integer \| string` | no | an id (a number, or its digits as text) |
| `path` | `string` | no | SVG path data for vector |
| `points` | `number[][]` | no | vector: instead of path |
| `props` | `object` | no |  |
| `select` | `boolean` | no |  |
| `text` | `string` | no | for text |
| `type` | `"rectangle" \| "ellipse" \| "polygon" \| "star" \| "line" \| "arrow" \| "vector" \| "text" \| "frame" \| "section" \| "component" \| "slice"` | no |  |
| `width` | `number` | no |  |
| `x` | `number` | no |  |
| `y` | `number` | no | relative to the parent frame; groups don't count |

## Call through design_run

```text
design_run {
  "path": "<file>.kdesign",
  "steps": [{ "command": "node.add" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `characters`, `closed`, `height`, `index`, `name`, `parent`, `path`, `points`, `props`, `select`, `text`, `type`, `width`, `x`, `y`. design_run answers the step’s result in `completed[i].result`.

## Result

The kit gives no result schema for this command.

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "characters": {
      "type": "string"
    },
    "closed": {
      "description": "vector points: a closed shape",
      "type": "boolean"
    },
    "height": {
      "type": "number"
    },
    "index": {
      "description": "a position counted from 0 (the first is 0)",
      "type": "integer"
    },
    "name": {
      "type": "string"
    },
    "parent": {
      "description": "an id (a number, or its digits as text)",
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        }
      ],
      "x-khp-types": [
        "Node"
      ]
    },
    "path": {
      "description": "SVG path data for vector",
      "type": "string"
    },
    "points": {
      "description": "vector: instead of path",
      "items": {
        "items": {
          "type": "number"
        },
        "type": "array"
      },
      "type": "array"
    },
    "props": {
      "additionalProperties": true,
      "type": "object"
    },
    "select": {
      "type": "boolean"
    },
    "text": {
      "description": "for text",
      "type": "string"
    },
    "type": {
      "enum": [
        "rectangle",
        "ellipse",
        "polygon",
        "star",
        "line",
        "arrow",
        "vector",
        "text",
        "frame",
        "section",
        "component",
        "slice"
      ],
      "type": "string"
    },
    "width": {
      "type": "number"
    },
    "x": {
      "type": "number"
    },
    "y": {
      "description": "relative to the parent frame; groups don't count",
      "type": "number"
    }
  },
  "type": "object"
}
```

Generated from the command list of @kition/design-darwin-arm64@0.1.0 and the kit itself (design_commands through @kition/cli@0.1.1, built from KitionAI/kition-design@abc7e16).
