---
title: "Admin UI with Block Kit"
description: "Build plugin admin pages and order panels with declarative blocks."
---

> Documentation Index
> Fetch the complete documentation index at: https://edgecart.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Admin UI with Block Kit

A plugin's admin UI is declarative JSON. The EdgeCart host renders the blocks;
the sandbox never sends JavaScript, CSS, or HTML to the admin.

## Declare a page

```json
{
  "capabilities": ["admin:ui"],
  "hooks": ["admin:interaction"],
  "admin": {
    "pages": [
      { "path": "overview", "label": "Loyalty", "icon": "ph:heart" }
    ]
  }
}
```

The installed plugin card links to the console page. The host loads the page
through `POST /api/plugins/installs/:id/admin/page` and dispatches actions
through `POST /api/plugins/installs/:id/admin/action`.

## Interaction model

The `admin:interaction` hook receives one of:

```json
{ "type": "page_load", "page": "overview" }
```

```json
{ "type": "block_action", "action": "refresh" }
```

```json
{ "type": "form_submit", "form": "settings", "values": {} }
```

The plugin returns the next blocks. The host validates every block before
rendering and re-checks installation status, release approval, `admin:ui`
consent, and the declared page on every call.

## Blocks

Common block types include:

- Layout: `header`, `section`, `divider`, `columns`, `tab`, `accordion`,
  `empty`.
- Data: `fields`, `table`, `stats`, `chart`, `code`, `context`, `image`.
- Actions: `actions`, `button`, `link`, `menu`.
- Forms: `form`, `text_input`, `number_input`, `select`, `toggle`,
  `secret_input`, `checkbox`, `date_input`, `combobox`, `radio`.
- Messaging: `banner`.

Tables and forms use scalar cells and declared field definitions. A form
submission is validated against the form schema before it reaches the plugin.

## Limits

- Admin response: 256 KiB, 20 levels, 2,000 nodes, 1,000 array items.
- Console page response: 64 KiB.
- Responsive requests are `no-store`.

## Order panels

`admin.orderPanel` renders blocks on the order detail page. Use it for
order-scoped summaries and actions; the host supplies the order context.

## Example response

```json
{
  "ok": true,
  "value": {
    "blocks": [
      { "type": "header", "text": "Loyalty" },
      {
        "type": "stats",
        "items": [
          { "label": "Members", "value": "128" },
          { "label": "Discount", "value": "5%" }
        ]
      },
      {
        "type": "form",
        "formId": "settings",
        "fields": [
          { "name": "percent", "label": "Discount percent", "type": "number" }
        ],
        "submitLabel": "Save"
      }
    ]
  }
}
```

## Related

- [Storefront slots and blocks](https://edgecart.dev/plugins/storefront)
- [Capabilities and hooks](https://edgecart.dev/plugins/capabilities-hooks)
- [Plugin manifest](https://edgecart.dev/plugins/manifest)

Source: https://edgecart.dev/plugins/admin-ui/index.mdx
