# EditBar

> 手机编辑器底部的编辑栏，点开一类命令时用同高的面板换下键盘。

网页来源：/components/edit-bar

版本：@quirekit/ui 0.3.1；源码修订：d79a6b48d00e+worktree。此文档对应当前源码构建，接入方式以开始使用为准。

接入前置：[开始使用](/raw/components/getting-started.md)（Vue、样式、主题与图标 Provider）。

`QuireEditBar` 是手机上编辑文档用的底部编辑栏，按[移动端编辑](/raw/design/mobile-editing.md)规范组织命令：左端切换键盘，中间是固定顺序的入口，右端是“更多”。点开有面板的入口时，键盘收起，面板出现在键盘原来的位置；再点同一入口或点键盘，回到输入。

编辑栏和面板都由 [Toolbar](/raw/components/toolbar.md) 绘制：入口是一条移动模式的 Toolbar，面板是同一套条目数据的多行 Toolbar。因此开关、选择器、菜单、拆分按钮和自定义控件的外观、键盘操作与事件路径都与桌面工具栏相同，面板按钮按桌面比例放大到 40px，拆分按钮的展开箭头保持窄条。

### 示例：edit-bar/basic

文件：`basic.vue`

```vue
<script setup lang="ts">
import { computed, ref, type CSSProperties } from "vue";
import { quireIconRegistry, type QuireKitEditBarEntry, type QuireKitEditBarKeyboardRequest, type QuireKitToolbarEntry, type QuireKitToolbarExecuteEvent } from "@quirekit/ui";
import { QuireCheckbox, QuireEditBar, QuireIconProvider } from "@quirekit/ui/vue";

// Host state: the edit bar only reports intents, the document owns formatting.
const panel = ref<string | null>(null);
const keyboard = ref(false);
const inTable = ref(false);
const marks = ref(new Set<string>(["bold"]));
const style = ref("body"), align = ref("start"), list = ref(""), color = ref("#000000"), size = ref("五号"), font = ref("Calibri");
const status = ref("");
/** Paragraph preview style: logical alignment maps to the physical value of a left-to-right page. */
const paragraphStyle = computed<CSSProperties>(() => ({ color: color.value,
  textAlign: align.value === "start" ? "left" : align.value === "end" ? "right" : align.value as CSSProperties["textAlign"] }));

/** @param value - Format identity. @param label - Accessible name. @param icon - Icon name. @returns A toggle reflecting the mark state. */
function mark(value: string, label: string, icon: string): QuireKitToolbarEntry {
  return { value, label, icon, kind: "toggle", pressed: marks.value.has(value) };
}
/** @param value - Choice identity. @param label - Visible name. @param current - Current choice. @param icon - Optional icon. @returns One toggle of a single-choice group. */
function choice(value: string, label: string, current: string, icon?: string): QuireKitToolbarEntry {
  return { value, label, ...(icon === undefined ? { text: label } : { icon }), kind: "toggle", pressed: value === current };
}

const colors = [["#000000", "黑色"], ["#C00000", "深红"], ["#E8710A", "橙色"], ["#188038", "绿色"], ["#1A73E8", "蓝色"], ["#7E57C2", "紫色"]];

const entries = computed((): readonly QuireKitEditBarEntry[] => [
  { value: "text", label: "文字", text: "Aa", panel: [
    { value: "marks", label: "字形", items: [{ value: "marks", label: "字形", kind: "group", children: [
      mark("bold", "加粗", "bold"), mark("italic", "斜体", "italic"), mark("underline", "下划线", "underline"),
      mark("strike", "删除线", "strike"), mark("highlight", "荧光笔", "textHighlight")
    ] }] },
    { value: "style", label: "段落样式", items: [{ value: "style", label: "段落样式", kind: "group", children: [
      choice("body", "正文", style.value), choice("h1", "标题 1", style.value), choice("h2", "标题 2", style.value), choice("h3", "标题 3", style.value)
    ] }] },
    { value: "font", label: "字体与字号", items: [
      { value: "family", label: "字体", kind: "menu", text: font.value,
        items: [{ value: "fonts", label: "字体", kind: "radio-group", selectedValue: font.value,
          children: ["Calibri", "宋体", "黑体", "楷体"].map(name => ({ value: name, label: name })) }] },
      { value: "size", label: "字号", kind: "group", children: [
        { value: "smaller", label: "减小字号", icon: "fontSizeDecrease" },
        { value: "size", label: "字号", kind: "menu", text: size.value,
          items: [{ value: "sizes", label: "字号", kind: "radio-group", selectedValue: size.value,
            children: ["小五", "五号", "小四", "四号", "小三", "三号"].map(name => ({ value: name, label: name })) }] },
        { value: "larger", label: "增大字号", icon: "fontSizeIncrease" }
      ] }
    ] },
    { value: "color", label: "字体颜色", items: [{ value: "color", label: "字体颜色", kind: "group", children: colors.map(([value, label]) => (
      { value: value!, label: label!, icon: "textColor", iconAccentColor: value!, kind: "toggle" as const, pressed: color.value === value }
    )) }] }
  ] },
  { value: "paragraph", label: "段落", icon: "alignStart", panel: [
    { value: "align", label: "对齐", items: [{ value: "align", label: "对齐", kind: "group", children: [
      choice("start", "起始对齐", align.value, "alignStart"), choice("center", "居中", align.value, "alignCenter"),
      choice("end", "末端对齐", align.value, "alignEnd"), choice("justify", "两端对齐", align.value, "alignJustify")
    ] }] },
    { value: "list", label: "列表", items: [{ value: "list", label: "列表", kind: "group", children: [
      choice("bullet", "项目符号", list.value, "listBullet"), choice("numbered", "编号", list.value, "listNumbered"), choice("task", "任务列表", list.value, "listTask")
    ] }] },
    { value: "move", label: "缩进与移动", items: [
      { value: "indent", label: "缩进", kind: "group", children: [
        { value: "outdent", label: "减少缩进", icon: "indentDecrease" }, { value: "indent", label: "增加缩进", icon: "indentIncrease" }
      ] },
      { value: "move", label: "移动段落", kind: "group", children: [
        { value: "up", label: "上移", icon: "moveUp" }, { value: "down", label: "下移", icon: "moveDown" }
      ] }
    ] },
    { value: "spacing", label: "行距", items: [{ value: "spacing", label: "行距", kind: "menu", text: "1.0",
      items: ["1.0", "1.15", "1.5", "2.0"].map(value => ({ value, label: value })) }] }
  ] },
  { value: "insert", label: "插入", icon: "plus", panel: [
    { value: "common", label: "常用", items: [
      { value: "image", label: "图片", icon: "image", text: "图片" }, { value: "table", label: "表格", icon: "table", text: "表格" }
    ] },
    { value: "objects", label: "对象", items: [
      { value: "link", label: "链接", icon: "link", text: "链接" }, { value: "shape", label: "形状", icon: "shapes", text: "形状" }
    ] },
    { value: "symbols", label: "符号", items: [
      { value: "equation", label: "公式", icon: "sigma", text: "公式" }, { value: "symbol", label: "符号", icon: "omega", text: "符号" }
    ] }
  ] },
  { value: "table", label: "表格", icon: "table", hidden: !inTable.value, panel: [
    { value: "rows", label: "行", items: [
      { value: "above", label: "上方插入行", text: "上方插入行" }, { value: "below", label: "下方插入行", text: "下方插入行" }
    ] },
    { value: "columns", label: "列", items: [
      { value: "before", label: "左侧插入列", text: "左侧插入列" }, { value: "after", label: "右侧插入列", text: "右侧插入列" }
    ] }
  ] },
  { value: "comment", label: "批注", icon: "messageSquareText" }
]);

/** @param event - Intent reported by the edit bar; the path names the entry and row. */
function execute(event: QuireKitToolbarExecuteEvent): void {
  const [entry, row] = event.path;
  if (event.source === "toggle" && row === "marks") {
    const next = new Set(marks.value);
    if (event.pressed === true) next.add(event.value); else next.delete(event.value);
    marks.value = next;
  } else if (row === "style") style.value = event.value;
  else if (row === "align") align.value = event.value;
  else if (row === "list") list.value = list.value === event.value ? "" : event.value;
  else if (row === "color") color.value = event.value;
  else if (event.path.includes("family")) font.value = event.value;
  else if (event.path.includes("size") && event.source === "menu") size.value = event.value;
  status.value = `已执行：${[entry, event.value].filter(Boolean).join(" · ")}`;
}
/** @param request - Keyboard transition; this demo only shows where the keyboard would be. */
function keyboardRequest(request: QuireKitEditBarKeyboardRequest): void { keyboard.value = request === "show"; }
</script>

<template>
  <QuireIconProvider :registry="quireIconRegistry">
    <div class="grid gap-qk-group p-qk-surface">
      <QuireCheckbox :checked="inTable" label="光标在表格中" @update:checked="inTable = $event === true" />
      <div class="grid h-[640px] w-[375px] max-w-full grid-rows-[minmax(0,1fr)_auto] overflow-hidden rounded-qk-overlay border border-qk-border-subtle bg-qk-surface-page">
        <div class="overflow-auto p-qk-surface" @click="keyboard = true; panel = null">
          <p class="m-0 qk-type-helper text-qk-text-secondary">点正文模拟弹出键盘</p>
          <p :class="{ 'font-bold': marks.has('bold'), italic: marks.has('italic'), underline: marks.has('underline'), 'line-through': marks.has('strike') }"
            :style="paragraphStyle">
            移动端的编辑栏固定在底部，点开一类命令时，面板换下键盘，正文始终可见。
          </p>
        </div>
        <div>
          <QuireEditBar v-model:panel="panel" label="编辑栏" :entries="entries" :keyboard="keyboard"
            :more="[{ value: 'find', label: '查找替换' }, { value: 'outline', label: '目录' }]"
            @execute="execute" @keyboard-request="keyboardRequest" />
          <div v-if="keyboard" class="grid h-[260px] place-items-center bg-qk-surface-hover qk-type-helper text-qk-text-secondary">系统键盘</div>
        </div>
      </div>
      <p role="status" class="m-0 qk-type-helper text-qk-text-secondary">{{ status || '点 Aa、段落或加号打开面板，再点一次回到键盘。' }}</p>
    </div>
  </QuireIconProvider>
</template>
```

## 入口

`entries` 按固定顺序列出入口。带 `panel` 的入口打开面板，其余入口直接执行。光标进入表格、选中图片时，把对应的对象入口从 `hidden` 改为显示；它出现或消失时，其他入口的位置不变，也不会自动打开面板。

`more` 是右端“更多”菜单的条目，放目录、查找替换这类低频任务；省略或为空时不显示。

## 面板

`panel` 是 Toolbar 的 `rows`，一项一个分组，按使用频率排序：

- 多个格式可同时生效时，用 `group` 包住若干 `toggle`，例如加粗、斜体、下划线。
- 一次只能选一个值时，同样用一组 `toggle`，由宿主只让当前值处于按下状态，例如对齐和段落样式。
- 一次性的动作用 `group` 包住若干动作，例如缩进和移动段落。
- 选项较多的设置用选择器或带 `text` 的 `menu`，与桌面工具栏一样显示当前值，例如字体和字号。用单选组（`radio-group`）列出选项，当前值会在弹层中显示为按下。

面板和编辑栏中的菜单、选择器都从屏幕底部弹出二级弹层，选择后弹层关闭，面板保持原样，“更多”同样如此。

面板里的控件按顺序连续排布，分组不单独起行：排满的行把剩余宽度均分到控件之间，不留右侧空白；最后一行从左侧开始。所有面板同高：四行控件的高度，可视高度不足 560px 时为三行，超出时在面板内滚动。

## 键盘

编辑栏不直接操作焦点或输入法，键盘的显示与收起由宿主的输入元素执行：

- `keyboard` 告诉编辑栏系统键盘当前是否可见。键盘重新出现时（例如点了正文），打开的面板自动关闭。
- 打开面板前，编辑栏发出 `keyboardRequest("hide")`；回到输入时发出 `keyboardRequest("show")`。
- 键盘按钮在键盘可见时名为“收起键盘”，否则为“键盘”。

## 事件

`execute` 的 `path` 以入口开头，后接行和条目的值，例如 `["text", "marks", "bold"]`；直接执行的入口只有自己的值；“更多”菜单的条目报告菜单项本身的值。`v-model:panel` 是当前打开面板的入口值，没有面板时为 `null`。

## API

### QuireEditBar

#### Props

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| label | 是 | — | Accessible name of the bar. |
| entries | 是 | — | Category and object entries between the keyboard toggle and More, in their fixed order. |
| more | 否 | — | Low-frequency tasks behind the trailing More menu; omitted or empty hides it. |
| keyboard | 否 | false | Whether the soft keyboard is showing, as observed by the host. |
| renderers | 否 | \{\} | Registered custom controls and popup bodies used by panel rows. |
| context | 否 | — | Host state forwarded unchanged to custom renderers. |
| portalTarget | 否 | — | Owning portal target for menus and popups opened from the bar or a panel. |
| panel | 否 | null | Entry whose panel currently replaces the keyboard, or null. |

**label**

```ts
string
```

**entries**

```ts
readonly QuireKitEditBarEntry[]
```

```ts
readonly ({
  /** Stable identity, first in every execute path that starts at this entry. */
  value: string;
  /** Accessible name and tooltip. */
  label: string;
  /** Provider icon name. */
  icon?: undefined | string;
  /** Visible text beside the icon, or in place of a missing icon. */
  text?: string | undefined;
  /** Toolbar rows of the panel this entry opens in place of the keyboard; omitted for an immediate action. */
  panel?: undefined | readonly ({
    /** Stable row identity, prepended to configured entry event paths. */
    value: string;
    /** Accessible name for this row's semantic group. */
    label: string;
    /** Ordered controls using the same contract as a single-row toolbar. */
    items: readonly ({
      /** Stable identity used in emitted intents and keyed rendering. */
      value: string;
      /** Visible or accessible action name; separator entries may use an empty label. */
      label: string;
      /** Entry behavior; omission means an immediate action. */
      kind?: "action" | "toggle" | "menu" | "selector" | "disclosure" | "split" | "group" | "separator" | "custom" | undefined;
      /** Provider icon name; without an icon the action displays its label. */
      icon?: string | undefined;
      /** Normalized icon data; takes precedence over a provider icon name. */
      iconData?: QuireKitIconData | undefined;
      /** Runtime accent used by stateful artwork such as a current-color underline. */
      iconAccentColor?: string | undefined;
      /** Whether stateful artwork represents an explicitly cleared value. */
      iconEmpty?: boolean | undefined;
      /** Tooltip explanation; defaults to label. False is for an enclosing compound tooltip owner. */
      tooltip?: string | false | undefined;
      /** Keyboard shortcut shown in the tooltip, in reading order such as `["⌘", "B"]`; display only, never registered. */
      shortcut?: readonly string[] | undefined;
      /** Explanation shown while this entry is unavailable. */
      disabledReason?: string | undefined;
      /** Native trigger data attributes; keyboard and interaction properties remain component-owned. */
      attributes?: Readonly<Record<`data-${string}`, string | number | boolean | undefined>> | undefined;
      /** Menu trigger appearance; selector displays a current value, disclosure represents an operation. */
      trigger?: "selector" | "disclosure" | undefined;
      /** Show the public disclosure indicator; menu disclosures default to true. */
      indicator?: boolean | undefined;
      /** Disclosure or custom-control popup semantics; false represents a persistent external panel. */
      popup?: false | QuireKitToolbarPopup | undefined;
      /** Public floating-surface options for Menu and Popover content. */
      overlayProps?: QuireKitToolbarOverlayProps | undefined;
      /** Optional text shown next to the icon. */
      text?: string | undefined;
      /** Width in toolbar units, where one unit is an icon action and half units are
    allowed. Omitted spans are derived from the entry kind in unit sizing; text
    and custom controls keep their natural width unless a span is declared. */
      span?: number | undefined;
      /** Whether activation and roving focus are unavailable. */
      disabled?: boolean | undefined;
      /** Hidden entries are unmounted and excluded from keyboard navigation. */
      hidden?: boolean | undefined;
      /** Whether the entry is shown in mobile mode. Defaults to true; false keeps
    desktop-only controls, such as launchers of desktop side panels, off touch toolbars. */
      mobile?: boolean | undefined;
      /** Host-defined metadata, such as a command id; never interpreted by Toolbar. */
      meta?: unknown;
      /** Default command parameters; custom renderers may supply a different payload. */
      payload?: unknown;
      /** Registry key for an arbitrary custom control using public Toolbar primitives. */
      renderer?: string | undefined;
      /** Registry key for a selector, disclosure, or split button's Popover body. */
      contentRenderer?: string | undefined;
      /** Popup body inset; none lets a composed list or picker own its outer spacing. Defaults to default. */
      contentPadding?: "default" | "none" | undefined;
      /** Controlled popup state; omission gives each mounted entry local state. */
      expanded?: boolean | undefined;
      /** Optional accessible description element id. */
      describedBy?: string | undefined;
      /** Split primary action name; defaults to label. */
      actionLabel?: string | undefined;
      /** Split primary explanation; defaults to its action name. */
      actionTooltip?: string | false | undefined;
      /** Split disclosure name; defaults to label. */
      disclosureLabel?: string | undefined;
      /** Split disclosure explanation; defaults to its disclosure name. */
      disclosureTooltip?: string | false | undefined;
      /** Disable only the split primary action. */
      actionDisabled?: boolean | undefined;
      /** Disable only the split disclosure. */
      disclosureDisabled?: boolean | undefined;
      /** Host-owned toggle state, also supported by a split entry primary action. */
      pressed?: QuireKitToolbarToggleState | undefined;
      /** Ordered children of a semantic group. */
      children?: readonly QuireKitToolbarEntry[] | undefined;
      /** Declarative menu entries for a menu trigger or split disclosure; takes precedence over split contentRenderer. */
      items?: readonly QuireKitMenuEntry[] | undefined;
    })[];
    /** Exclude the row from layout and keyboard navigation. */
    hidden?: boolean | undefined;
    /** Inherited availability for every control in this row. */
    disabled?: boolean | undefined;
  })[];
  /** Shown on the bar (default), or listed in the trailing More menu and opened from there. */
  placement?: undefined | "more" | "bar";
  /** Hidden entries take no place, as an object entry while no object is current. */
  hidden?: boolean | undefined;
  /** Unavailable entries keep their place. */
  disabled?: boolean | undefined;
})[]
```

**more**

```ts
readonly QuireKitMenuEntry[] | undefined
```

```ts
undefined | readonly ({
  /** Stable identity emitted for executable rows. */
  value: string;
  /** Localized visible label. */
  label: string;
  /** Group, submenu or ordinary action. */
  kind?: undefined | "group" | "separator" | "item" | "submenu" | "radio-group";
  /** Ordered rows belonging to a group or submenu. */
  children?: readonly QuireKitMenuEntry[] | undefined;
  /** Whether activation is unavailable. */
  disabled?: boolean | undefined;
  /** Optional explanation of an unavailable action. */
  reason?: undefined | string;
  /** Shortcut rendered with Kbd; pass explicit keys for combined shortcuts, or a legacy display string. */
  shortcut?: undefined | string | readonly (string)[];
  /** Icon name resolved by the current QuireIconProvider. */
  icon?: string | undefined;
  /** Current value of a radio group; its children describe the options. */
  selectedValue?: string | undefined;
  /** Whether activating a leaf closes the menu; checkboxes and radio items default to false. */
  closeOnSelect?: boolean | undefined;
  /** Checked state for a toggle row; omission is an ordinary action. */
  checked?: boolean | undefined;
  /** Visual action emphasis. */
  tone?: undefined | "neutral" | "danger";
})[]
```

**keyboard**

```ts
boolean | undefined
```

**renderers**

```ts
Readonly<Record<string, Component>> | undefined
```

```ts
undefined | Readonly<Record<string, Component>>
```

**context**

```ts
unknown
```

**portalTarget**

```ts
string | HTMLElement | undefined
```

```ts
undefined | string | HTMLElement
```

**panel**

```ts
string | null | undefined
```

```ts
undefined | null | string
```

#### Events

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| update\:panel | 否 | — |  |
| execute | 否 | — |  |
| openChange | 否 | — |  |
| keyboardRequest | 否 | — |  |

**update:panel**

```ts
[value: string | null]
```

**execute**

```ts
[event: QuireKitToolbarExecuteEvent]
```

**openChange**

```ts
[event: QuireKitToolbarOpenChangeEvent]
```

**keyboardRequest**

```ts
[request: QuireKitEditBarKeyboardRequest]
```

#### Slots

无。

#### 公开实例成员

无。

#### 相关类型

```ts
type QuireKitEditBarEntry = {
  /** Stable identity, first in every execute path that starts at this entry. */
  value: string;
  /** Accessible name and tooltip. */
  label: string;
  /** Provider icon name. */
  icon?: undefined | string;
  /** Visible text beside the icon, or in place of a missing icon. */
  text?: string | undefined;
  /** Toolbar rows of the panel this entry opens in place of the keyboard; omitted for an immediate action. */
  panel?: undefined | readonly ({
    /** Stable row identity, prepended to configured entry event paths. */
    value: string;
    /** Accessible name for this row's semantic group. */
    label: string;
    /** Ordered controls using the same contract as a single-row toolbar. */
    items: readonly QuireKitToolbarEntry[];
    /** Exclude the row from layout and keyboard navigation. */
    hidden?: boolean | undefined;
    /** Inherited availability for every control in this row. */
    disabled?: boolean | undefined;
  })[];
  /** Shown on the bar (default), or listed in the trailing More menu and opened from there. */
  placement?: undefined | "more" | "bar";
  /** Hidden entries take no place, as an object entry while no object is current. */
  hidden?: boolean | undefined;
  /** Unavailable entries keep their place. */
  disabled?: boolean | undefined;
};
```

```ts
type QuireKitToolbarRow = {
  /** Stable row identity, prepended to configured entry event paths. */
  value: string;
  /** Accessible name for this row's semantic group. */
  label: string;
  /** Ordered controls using the same contract as a single-row toolbar. */
  items: readonly ({
    /** Stable identity used in emitted intents and keyed rendering. */
    value: string;
    /** Visible or accessible action name; separator entries may use an empty label. */
    label: string;
    /** Entry behavior; omission means an immediate action. */
    kind?: "action" | "toggle" | "menu" | "selector" | "disclosure" | "split" | "group" | "separator" | "custom" | undefined;
    /** Provider icon name; without an icon the action displays its label. */
    icon?: string | undefined;
    /** Normalized icon data; takes precedence over a provider icon name. */
    iconData?: QuireKitIconData | undefined;
    /** Runtime accent used by stateful artwork such as a current-color underline. */
    iconAccentColor?: string | undefined;
    /** Whether stateful artwork represents an explicitly cleared value. */
    iconEmpty?: boolean | undefined;
    /** Tooltip explanation; defaults to label. False is for an enclosing compound tooltip owner. */
    tooltip?: string | false | undefined;
    /** Keyboard shortcut shown in the tooltip, in reading order such as `["⌘", "B"]`; display only, never registered. */
    shortcut?: readonly string[] | undefined;
    /** Explanation shown while this entry is unavailable. */
    disabledReason?: string | undefined;
    /** Native trigger data attributes; keyboard and interaction properties remain component-owned. */
    attributes?: Readonly<Record<`data-${string}`, string | number | boolean | undefined>> | undefined;
    /** Menu trigger appearance; selector displays a current value, disclosure represents an operation. */
    trigger?: "selector" | "disclosure" | undefined;
    /** Show the public disclosure indicator; menu disclosures default to true. */
    indicator?: boolean | undefined;
    /** Disclosure or custom-control popup semantics; false represents a persistent external panel. */
    popup?: false | QuireKitToolbarPopup | undefined;
    /** Public floating-surface options for Menu and Popover content. */
    overlayProps?: QuireKitToolbarOverlayProps | undefined;
    /** Optional text shown next to the icon. */
    text?: string | undefined;
    /** Width in toolbar units, where one unit is an icon action and half units are
  allowed. Omitted spans are derived from the entry kind in unit sizing; text
  and custom controls keep their natural width unless a span is declared. */
    span?: number | undefined;
    /** Whether activation and roving focus are unavailable. */
    disabled?: boolean | undefined;
    /** Hidden entries are unmounted and excluded from keyboard navigation. */
    hidden?: boolean | undefined;
    /** Whether the entry is shown in mobile mode. Defaults to true; false keeps
  desktop-only controls, such as launchers of desktop side panels, off touch toolbars. */
    mobile?: boolean | undefined;
    /** Host-defined metadata, such as a command id; never interpreted by Toolbar. */
    meta?: unknown;
    /** Default command parameters; custom renderers may supply a different payload. */
    payload?: unknown;
    /** Registry key for an arbitrary custom control using public Toolbar primitives. */
    renderer?: string | undefined;
    /** Registry key for a selector, disclosure, or split button's Popover body. */
    contentRenderer?: string | undefined;
    /** Popup body inset; none lets a composed list or picker own its outer spacing. Defaults to default. */
    contentPadding?: "default" | "none" | undefined;
    /** Controlled popup state; omission gives each mounted entry local state. */
    expanded?: boolean | undefined;
    /** Optional accessible description element id. */
    describedBy?: string | undefined;
    /** Split primary action name; defaults to label. */
    actionLabel?: string | undefined;
    /** Split primary explanation; defaults to its action name. */
    actionTooltip?: string | false | undefined;
    /** Split disclosure name; defaults to label. */
    disclosureLabel?: string | undefined;
    /** Split disclosure explanation; defaults to its disclosure name. */
    disclosureTooltip?: string | false | undefined;
    /** Disable only the split primary action. */
    actionDisabled?: boolean | undefined;
    /** Disable only the split disclosure. */
    disclosureDisabled?: boolean | undefined;
    /** Host-owned toggle state, also supported by a split entry primary action. */
    pressed?: QuireKitToolbarToggleState | undefined;
    /** Ordered children of a semantic group. */
    children?: readonly QuireKitToolbarEntry[] | undefined;
    /** Declarative menu entries for a menu trigger or split disclosure; takes precedence over split contentRenderer. */
    items?: readonly QuireKitMenuEntry[] | undefined;
  })[];
  /** Exclude the row from layout and keyboard navigation. */
  hidden?: boolean | undefined;
  /** Inherited availability for every control in this row. */
  disabled?: boolean | undefined;
};
```

```ts
type QuireKitToolbarEntry = {
  /** Stable identity used in emitted intents and keyed rendering. */
  value: string;
  /** Visible or accessible action name; separator entries may use an empty label. */
  label: string;
  /** Entry behavior; omission means an immediate action. */
  kind?: undefined | "action" | "toggle" | "menu" | "selector" | "disclosure" | "split" | "group" | "separator" | "custom";
  /** Provider icon name; without an icon the action displays its label. */
  icon?: string | undefined;
  /** Normalized icon data; takes precedence over a provider icon name. */
  iconData?: undefined | {
    /** Normalized trusted SVG markup rendered by framework adapters. */
    svg: string;
    /** Intrinsic SVG coordinate system retained for audits and previews. */
    viewBox: string;
    /** Source family used to audit licensing and visual consistency. */
    source: QuireKitIconSource;
    /** Upstream or product license identifier for the glyph. */
    license: string;
    /** Whether directional artwork should mirror in right-to-left layouts. */
    mirrorInRtl: boolean;
    /** Centered optical scale used to normalize visually oversized artwork. */
    opticalScale: number;
    /** Number of visible SVG geometry elements in the normalized glyph. */
    complexity: number;
  };
  /** Runtime accent used by stateful artwork such as a current-color underline. */
  iconAccentColor?: string | undefined;
  /** Whether stateful artwork represents an explicitly cleared value. */
  iconEmpty?: boolean | undefined;
  /** Tooltip explanation; defaults to label. False is for an enclosing compound tooltip owner. */
  tooltip?: undefined | string | false;
  /** Keyboard shortcut shown in the tooltip, in reading order such as `["⌘", "B"]`; display only, never registered. */
  shortcut?: undefined | readonly (string)[];
  /** Explanation shown while this entry is unavailable. */
  disabledReason?: string | undefined;
  /** Native trigger data attributes; keyboard and interaction properties remain component-owned. */
  attributes?: undefined | Readonly<Record<`data-${string}`, string | number | boolean | undefined>>;
  /** Menu trigger appearance; selector displays a current value, disclosure represents an operation. */
  trigger?: undefined | "selector" | "disclosure";
  /** Show the public disclosure indicator; menu disclosures default to true. */
  indicator?: boolean | undefined;
  /** Disclosure or custom-control popup semantics; false represents a persistent external panel. */
  popup?: undefined | false | "menu" | "dialog" | "grid" | "listbox" | "tree";
  /** Public floating-surface options for Menu and Popover content. */
  overlayProps?: undefined | {
    /** Owning document's public portal target. */
    portalTarget?: string | HTMLElement | undefined;
    /** Whether an ordinary menu selection closes immediately; controlled hosts may close after success. */
    closeOnSelect?: boolean | undefined;
    /** Menu's fixed content width. */
    width?: QuireKitMenuLength | undefined;
    /** Menu's minimum content width. */
    minWidth?: QuireKitMenuLength | undefined;
    /** Menu's maximum content width. */
    maxWidth?: QuireKitMenuLength | undefined;
    /** Host content language and stable application markers. */
    contentAttributes?: QuireKitToolbarContentAttributes | undefined;
    /** Whether a disclosure or selector popover returns focus to its trigger on close; false when the host hands focus elsewhere. */
    restoreFocus?: boolean | undefined;
  };
  /** Optional text shown next to the icon. */
  text?: string | undefined;
  /** Width in toolbar units, where one unit is an icon action and half units are
allowed. Omitted spans are derived from the entry kind in unit sizing; text
and custom controls keep their natural width unless a span is declared. */
  span?: undefined | number;
  /** Whether activation and roving focus are unavailable. */
  disabled?: boolean | undefined;
  /** Hidden entries are unmounted and excluded from keyboard navigation. */
  hidden?: boolean | undefined;
  /** Whether the entry is shown in mobile mode. Defaults to true; false keeps
desktop-only controls, such as launchers of desktop side panels, off touch toolbars. */
  mobile?: boolean | undefined;
  /** Host-defined metadata, such as a command id; never interpreted by Toolbar. */
  meta?: unknown;
  /** Default command parameters; custom renderers may supply a different payload. */
  payload?: unknown;
  /** Registry key for an arbitrary custom control using public Toolbar primitives. */
  renderer?: string | undefined;
  /** Registry key for a selector, disclosure, or split button's Popover body. */
  contentRenderer?: string | undefined;
  /** Popup body inset; none lets a composed list or picker own its outer spacing. Defaults to default. */
  contentPadding?: undefined | "default" | "none";
  /** Controlled popup state; omission gives each mounted entry local state. */
  expanded?: boolean | undefined;
  /** Optional accessible description element id. */
  describedBy?: string | undefined;
  /** Split primary action name; defaults to label. */
  actionLabel?: string | undefined;
  /** Split primary explanation; defaults to its action name. */
  actionTooltip?: string | false | undefined;
  /** Split disclosure name; defaults to label. */
  disclosureLabel?: string | undefined;
  /** Split disclosure explanation; defaults to its disclosure name. */
  disclosureTooltip?: string | false | undefined;
  /** Disable only the split primary action. */
  actionDisabled?: boolean | undefined;
  /** Disable only the split disclosure. */
  disclosureDisabled?: boolean | undefined;
  /** Host-owned toggle state, also supported by a split entry primary action. */
  pressed?: undefined | false | true | "mixed";
  /** Ordered children of a semantic group. */
  children?: undefined | readonly QuireKitToolbarEntry[];
  /** Declarative menu entries for a menu trigger or split disclosure; takes precedence over split contentRenderer. */
  items?: undefined | readonly ({
    /** Stable identity emitted for executable rows. */
    value: string;
    /** Localized visible label. */
    label: string;
    /** Group, submenu or ordinary action. */
    kind?: "group" | "separator" | "item" | "submenu" | "radio-group" | undefined;
    /** Ordered rows belonging to a group or submenu. */
    children?: readonly QuireKitMenuEntry[] | undefined;
    /** Whether activation is unavailable. */
    disabled?: boolean | undefined;
    /** Optional explanation of an unavailable action. */
    reason?: string | undefined;
    /** Shortcut rendered with Kbd; pass explicit keys for combined shortcuts, or a legacy display string. */
    shortcut?: string | readonly string[] | undefined;
    /** Icon name resolved by the current QuireIconProvider. */
    icon?: string | undefined;
    /** Current value of a radio group; its children describe the options. */
    selectedValue?: string | undefined;
    /** Whether activating a leaf closes the menu; checkboxes and radio items default to false. */
    closeOnSelect?: boolean | undefined;
    /** Checked state for a toggle row; omission is an ordinary action. */
    checked?: boolean | undefined;
    /** Visual action emphasis. */
    tone?: QuireKitMenuItemTone | undefined;
  })[];
};
```

```ts
type QuireKitIconData = {
  /** Normalized trusted SVG markup rendered by framework adapters. */
  svg: string;
  /** Intrinsic SVG coordinate system retained for audits and previews. */
  viewBox: string;
  /** Source family used to audit licensing and visual consistency. */
  source: "custom" | "lucide" | "tabler";
  /** Upstream or product license identifier for the glyph. */
  license: string;
  /** Whether directional artwork should mirror in right-to-left layouts. */
  mirrorInRtl: boolean;
  /** Centered optical scale used to normalize visually oversized artwork. */
  opticalScale: number;
  /** Number of visible SVG geometry elements in the normalized glyph. */
  complexity: number;
};
```

```ts
type QuireKitIconSource = "custom" | "lucide" | "tabler";
```

```ts
type QuireKitToolbarOverlayProps = {
  /** Owning document's public portal target. */
  portalTarget?: undefined | string | HTMLElement;
  /** Whether an ordinary menu selection closes immediately; controlled hosts may close after success. */
  closeOnSelect?: boolean | undefined;
  /** Menu's fixed content width. */
  width?: undefined | string | number;
  /** Menu's minimum content width. */
  minWidth?: QuireKitMenuLength | undefined;
  /** Menu's maximum content width. */
  maxWidth?: QuireKitMenuLength | undefined;
  /** Host content language and stable application markers. */
  contentAttributes?: undefined | {
    /** Optional application content class. */
    class?: string | undefined;
    /** Language inherited by the floating content. */
    lang?: string | undefined;
    /** Direction inherited by the floating content. */
    dir?: QuireKitToolbarDirection | undefined;
  };
  /** Whether a disclosure or selector popover returns focus to its trigger on close; false when the host hands focus elsewhere. */
  restoreFocus?: boolean | undefined;
};
```

```ts
type QuireKitToolbarContentAttributes = {
  /** Optional application content class. */
  class?: string | undefined;
  /** Language inherited by the floating content. */
  lang?: string | undefined;
  /** Direction inherited by the floating content. */
  dir?: undefined | "ltr" | "rtl";
};
```

```ts
type QuireKitMenuEntry = {
  /** Stable identity emitted for executable rows. */
  value: string;
  /** Localized visible label. */
  label: string;
  /** Group, submenu or ordinary action. */
  kind?: undefined | "group" | "separator" | "item" | "submenu" | "radio-group";
  /** Ordered rows belonging to a group or submenu. */
  children?: readonly QuireKitMenuEntry[] | undefined;
  /** Whether activation is unavailable. */
  disabled?: boolean | undefined;
  /** Optional explanation of an unavailable action. */
  reason?: undefined | string;
  /** Shortcut rendered with Kbd; pass explicit keys for combined shortcuts, or a legacy display string. */
  shortcut?: undefined | string | readonly (string)[];
  /** Icon name resolved by the current QuireIconProvider. */
  icon?: string | undefined;
  /** Current value of a radio group; its children describe the options. */
  selectedValue?: string | undefined;
  /** Whether activating a leaf closes the menu; checkboxes and radio items default to false. */
  closeOnSelect?: boolean | undefined;
  /** Checked state for a toggle row; omission is an ordinary action. */
  checked?: boolean | undefined;
  /** Visual action emphasis. */
  tone?: undefined | "neutral" | "danger";
};
```
