SxOverflow (溢出处理)

  • Implemented

自动处理容器内溢出项(如工具栏自动收纳更多)。对齐 Microsoft Fluent UI Blazor Overflow (v4.13.2) 的 API 结构,并说明 NextUI 当前实现状态。

使用场景

  • 工具栏项过多的收纳
  • 操作按钮溢出展示
  • 菜单或标签的自适应容器

约束说明

  • 需要配合 ItemTemplate 渲染具体项。
  • OverflowTemplate 当前为占位渲染。

行为说明

  • Items 渲染为溢出项集合。
  • 若设置 OverflowTemplate 则显示溢出入口。

API

Parameters (参数)

状态 参数名 类型 默认值 描述
Implemented Items IEnumerable<TItem>? null 溢出项数据源。
Implemented ItemTemplate RenderFragment<TItem>? null 单项渲染模版。
Implemented OverflowTemplate RenderFragment<IEnumerable<TItem>>? null 溢出内容模版。
Implemented Id (继承) string? null 组件的物理 Id。
Implemented Class (继承) string? null 自定义 CSS 类名。
Implemented Style (继承) string? null 自定义样式。
Implemented Title (继承) string? null HTML title 属性。
Implemented AdditionalAttributes (继承) IEnumerable<KeyValuePair<string, object>>? null 捕获不匹配的 HTML 属性。

示例

<SxOverflow Items="@_items" ItemTemplate="item => @<span>@item</span>">
    <OverflowTemplate>
        @<SxButton>更多</SxButton>
    </OverflowTemplate>
</SxOverflow>

参考设计 (References)