For AI agents: the complete documentation index is available at https://a3s-lab.github.io/UI/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/UI/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/UI/components/context-selector.md.

上下文选择器

上下文选择器为模型、权限和工作区提供一套紧凑契约。选项符合普通选择行为时优先使用原生 Select。

实时预览

用法

<label class="context-selector" data-kind="workspace">
  <span data-context-label>工作区</span>
  <select aria-label="工作区"><option>A3S UI</option></select>
  <span data-context-description>文件和任务历史限定在此范围。</span>
</label>

参数

API取值用途
data-kindmodel、permission、workspace选择语义
原生 <select>优先普通有限选择
button[aria-haspopup]可选可搜索的丰富锚定菜单
data-context-description推荐说明选择后果

状态与变体

当原因能帮助恢复时,保留不可用选项并说明原因。视觉选中状态不能暗示权限已经授予。

无障碍

使用原生标签与控件名称。锚定菜单关闭后恢复触发器焦点,并限制在视口内。