---
title: "inspect.code: Code for layer — Design kit command — Kition"
description: "Answers code for a layer in CSS, HTML, React, Vue, Tailwind, SwiftUI, Compose and more, with unit options."
canonical: "https://developer.kition.ai/docs/kits/design/commands/inspect.code"
---

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

# inspect.code

**Code for layer.** Answers code for a layer in CSS, HTML, React, Vue, Tailwind, SwiftUI, Compose and more, with unit options.

- 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 |  |
| `language` | `"css" \| "html" \| "react" \| "leptos" \| "vue" \| "tailwind" \| "swiftui" \| "compose" \| "arkui"` | no | default css; html, react, leptos and vue are the whole layer tree; components take their properties as parameters, instances pass their values; a component connected to code (codeConnect.set) gives its import and snippet instead; tailwind is React with Tailwind CSS v4 utilities for pages: fluid auto layout boxes, instances inlined with their overrides, bound variables as theme utilities |
| `mobile` | `boolean` | no |  |
| `rootFontSize` | `number` | no |  |
| `unit` | `"px" \| "rem"` | no |  |

## Call through design_run

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

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

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | no |  |
| `connected` | `boolean` | no |  |
| `language` | `string` | no |  |

```json
{
  "additionalProperties": true,
  "properties": {
    "code": {
      "type": "string"
    },
    "connected": {
      "type": "boolean"
    },
    "language": {
      "type": "string"
    }
  },
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "id": {
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        }
      ],
      "x-khp-types": [
        "Node"
      ]
    },
    "language": {
      "description": "default css; html, react, leptos and vue are the whole layer tree; components take their properties as parameters, instances pass their values; a component connected to code (codeConnect.set) gives its import and snippet instead; tailwind is React with Tailwind CSS v4 utilities for pages: fluid auto layout boxes, instances inlined with their overrides, bound variables as theme utilities",
      "enum": [
        "css",
        "html",
        "react",
        "leptos",
        "vue",
        "tailwind",
        "swiftui",
        "compose",
        "arkui"
      ],
      "type": "string"
    },
    "mobile": {
      "type": "boolean"
    },
    "rootFontSize": {
      "type": "number"
    },
    "unit": {
      "enum": [
        "px",
        "rem"
      ],
      "type": "string"
    }
  },
  "returns": "{code, language, connected}",
  "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).
