---
title: "inspect.componentCode: Component code — Design kit command — Kition"
description: "Answers a component's code in a language with its properties as parameters."
canonical: "https://developer.kition.ai/docs/kits/design/commands/inspect.componentCode"
---

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

# inspect.componentCode

**Component code.** Answers a component's code in a language with its properties as parameters.

- Kit: Design 0.1.0 (.kdesign); reference: [Design kit commands](https://developer.kition.ai/docs/kits/design.md)
- Changes the document: no
- Acts on: `id` (one id), which a run step’s `on` fills

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer \| string` | no | an id; component, set or instance; default the selection |
| `language` | `"react" \| "leptos" \| "vue" \| "swiftui" \| "compose" \| "arkui"` | no | default react |

## Call through design_run

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

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

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `component` | `any` | no |  |
| `connected` | `object` | no |  |
| `definition` | `any` | no |  |
| `name` | `any` | no |  |
| `properties` | `any[]` | no |  |
| `set` | `any` | no |  |
| `usage` | `any` | no |  |

```json
{
  "additionalProperties": true,
  "properties": {
    "component": {},
    "connected": {
      "additionalProperties": true,
      "type": "object"
    },
    "definition": {},
    "name": {},
    "properties": {
      "type": "array"
    },
    "set": {},
    "usage": {}
  },
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "an id; component, set or instance; default the selection",
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        }
      ],
      "x-khp-types": [
        "Node"
      ]
    },
    "language": {
      "description": "default react",
      "enum": [
        "react",
        "leptos",
        "vue",
        "swiftui",
        "compose",
        "arkui"
      ],
      "type": "string"
    }
  },
  "returns": "{component, name, set, properties: [{name, param, type, default, value? (instances)}], definition, usage? (instances; the connected snippet when the component is connected to code), connected: {importPath, name, template, import, code} | null}",
  "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).
