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

文件类型图标

在文件列表和附件中提供稳定、克制的类型提示,同时让真实文件名继续承担主要识别职责。

实时预览
TS

用法

<span class="file-type-icon" role="img" aria-label="TypeScript file" style="--file-color:#249bf6">
  <span data-file-extension>TS</span>
</span>

契约

接口值
根选择器.file-type-icon
原生根元素<span>
状态ready, generic, known, host-provided
事件—
方法—

产品边界

图标不判断文件安全性、可执行能力或 MIME 真实性。品牌与供应商图形由宿主通过通用图标槽提供。

组件只发布可复用的交互边界。数据获取、持久化、权限、可信内容与业务实体继续由宿主产品拥有。

可访问性

装饰性图标使用 aria-hidden;仅显示图标时必须提供文件类型名称。扩展名文字保持可读,不能只靠颜色区分。