Duostrap Separator
使用家族边框色的单像素水平与垂直分隔组件,继承 Base Separator。
Duostrap Separator 使用适配明暗主题家族边框色的单像素分隔线,由 Base Separator 统一管理水平/垂直方向与装饰性无障碍语义。这是基于归档分隔线语法与家族调色板的简化扩展。
Web Components React Vue Vue 2
正在加载交互示例… 正文和源码已可阅读,交互控件就绪后会显示在这里。
<div
class="flex w-full max-w-sm flex-col gap-4 rounded border border-[#e3e3e3] bg-[#f5f5f5] p-4 text-sm text-[#333333]"
>
<div class="flex flex-col gap-1.5">
<div class="leading-none font-bold">Proto UI</div>
<div class="text-[#666666]">
The foundation for your design system.
</div>
</div>
<wc-duostrap-separator-root></wc-duostrap-separator-root>
<div>
A set of portable component protocols that you can customize,
extend, and build on.
</div>
</div>将于 0.3.0-rc.1 及后续版本中提供。可从 @proto.ui/prototypes-duostrap/separator 导入 separatorRoot。查看已实现的子集。
import { separatorRoot } from '@proto.ui/prototypes-duostrap/separator';import { BootstrapSeparatorRoot } from '../proto-ui/components/react';<BootstrapSeparatorRoot />- 家族边框样式:水平方向高
1px,垂直方向宽1px并沿弹性容器交叉轴自动拉伸(self-stretch),两种方向均使用家族边框色。 - 装饰性与语义模式:默认
decorative={true}对辅助技术隐藏;当分隔线代表真实内容区块边界时,设置decorative={false}暴露role="separator"与aria-orientation。 - 尺寸与布局:组件无子内容且不占用焦点顺序,不内置外边距,长度与间距由外层容器控制。
Web Components React Vue Vue 2
正在加载交互示例… 正文和源码已可阅读,交互控件就绪后会显示在这里。
<div
class="flex h-9 items-center gap-4 rounded border border-[#e3e3e3] bg-[#f5f5f5] px-4 py-2 text-sm text-[#333333]"
>
<div>Blog</div>
<wc-duostrap-separator-root
orientation="vertical"
></wc-duostrap-separator-root>
<div>Docs</div>
<wc-duostrap-separator-root
orientation="vertical"
></wc-duostrap-separator-root>
<div>Source</div>
</div> Web Components React Vue Vue 2
正在加载交互示例… 正文和源码已可阅读,交互控件就绪后会显示在这里。
<div
class="flex items-center gap-3 rounded border border-[#e3e3e3] bg-[#f5f5f5] px-4 py-3 text-sm text-[#333333] md:gap-4"
>
<div class="flex flex-col gap-1">
<span class="font-bold">Settings</span>
<span class="text-xs text-[#666666]">Manage preferences</span>
</div>
<wc-duostrap-separator-root
orientation="vertical"
></wc-duostrap-separator-root>
<div class="flex flex-col gap-1">
<span class="font-bold">Account</span>
<span class="text-xs text-[#666666]">
Profile & security
</span>
</div>
<wc-duostrap-separator-root
orientation="vertical"
class="hidden md:block"
></wc-duostrap-separator-root>
<div class="hidden flex-col gap-1 md:flex">
<span class="font-bold">Help</span>
<span class="text-xs text-[#666666]">Support & docs</span>
</div>
</div>列表与语义分隔
Section titled “列表与语义分隔” Web Components React Vue Vue 2
正在加载交互示例… 正文和源码已可阅读,交互控件就绪后会显示在这里。
<div
class="flex w-full max-w-sm flex-col gap-2.5 rounded border border-[#e3e3e3] bg-[#f5f5f5] p-4 text-sm text-[#333333]"
>
<div class="flex items-center justify-between">
<span>Item 1</span>
<span class="text-[#666666]">Value 1</span>
</div>
<wc-duostrap-separator-root
decorative="false"
></wc-duostrap-separator-root>
<div class="flex items-center justify-between">
<span>Item 2</span>
<span class="text-[#666666]">Value 2</span>
</div>
<wc-duostrap-separator-root
decorative="false"
></wc-duostrap-separator-root>
<div class="flex items-center justify-between">
<span>Item 3</span>
<span class="text-[#666666]">Value 3</span>
</div>
</div> Web Components React Vue Vue 2
正在加载交互示例… 正文和源码已可阅读,交互控件就绪后会显示在这里。
<div
dir="rtl"
class="flex w-full max-w-sm flex-col gap-4 rounded border border-[#e3e3e3] bg-[#f5f5f5] p-4 text-sm text-[#333333]"
>
<div class="flex flex-col gap-1.5">
<div class="leading-none font-bold">Proto UI</div>
<div class="text-[#666666]">الأساس لنظام التصميم الخاص بك</div>
</div>
<wc-duostrap-separator-root></wc-duostrap-separator-root>
<div>
مجموعة من المكونات القابلة للتخصيص والتوسيع والبناء عليها.
</div>
</div>以下属性属于 Root:
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
orientation | 'horizontal' 'vertical' | 'horizontal' | 分隔线方向 |
decorative | boolean | true | 设为 false 时暴露语义 role="separator" 与 aria-orientation |
暴露只读状态 orientation 与 decorative,不声明焦点或交互事件。