---
title: "element.getStyle: Read style — Board kit command — Kition"
description: "Reads the style fields the elements use, or a new element's defaults for a kind, without changing anything; null marks a field the elements differ on. Also answers the colour palette."
canonical: "https://developer.kition.ai/docs/kits/board/commands/element.getStyle"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/board/commands/element.getStyle](https://developer.kition.ai/docs/kits/board/commands/element.getStyle)

# element.getStyle

**Read style.** Reads the style fields the elements use, or a new element's defaults for a kind, without changing anything; null marks a field the elements differ on. Also answers the colour palette.

- Kit: Board 0.1.0 (.kboard); reference: [Board kit commands](https://developer.kition.ai/docs/kits/board.md)
- Changes the document: no
- Acts on: `ids` (a list of ids), which a run step’s `on` fills

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `ids` | `string[]` | no | The elements (instead of kind) |
| `kind` | `"shape" \| "text" \| "stroke" \| "connector" \| "image" \| "card" \| "frame"` | no | A new element's kind, for its defaults (instead of ids) |
| `shapeStyle` | `"default" \| "sticky" \| "mind-node" \| "flow-node" \| "image-placeholder"` | no | The new shape's role |

## Call through board_run

```text
board_run {
  "path": "<file>.kboard",
  "steps": [{ "command": "element.getStyle" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `ids`, `kind`, `shapeStyle`. board_run answers the step’s result in `completed[i].result`.

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `fields` | `string[]` | yes | The style fields the elements use, in element.style order |
| `palette` | `object[]` | yes |  |
| `style` | `object` | yes | Each field's value; null where the elements differ |

```json
{
  "additionalProperties": false,
  "properties": {
    "fields": {
      "description": "The style fields the elements use, in element.style order",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "palette": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "fill": {
            "type": "string"
          },
          "stroke": {
            "type": "string"
          },
          "token": {
            "type": "string"
          }
        },
        "required": [
          "fill",
          "stroke",
          "token"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "style": {
      "additionalProperties": true,
      "description": "Each field's value; null where the elements differ",
      "type": "object"
    }
  },
  "required": [
    "fields",
    "palette",
    "style"
  ],
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "ids": {
      "description": "The elements (instead of kind)",
      "items": {
        "type": "string"
      },
      "type": "array",
      "x-khp-types": [
        "Element"
      ]
    },
    "kind": {
      "description": "A new element's kind, for its defaults (instead of ids)",
      "enum": [
        "shape",
        "text",
        "stroke",
        "connector",
        "image",
        "card",
        "frame"
      ],
      "type": "string"
    },
    "shapeStyle": {
      "description": "The new shape's role",
      "enum": [
        "default",
        "sticky",
        "mind-node",
        "flow-node",
        "image-placeholder"
      ],
      "type": "string"
    }
  },
  "type": "object"
}
```

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