فاصل
خط رفيع بين مجموعتين، عرضيًا في عمود أو طوليًا في صف. زخرفي افتراضيًا، فلا يُعلَن لقارئ الشاشة.
server - 0 KB
فاصل
server - 0 KBخط رفيع بين مجموعتين، عرضيًا في عمود أو طوليًا في صف. زخرفي افتراضيًا، فلا يُعلَن لقارئ الشاشة.
ProfileBilling
جرّبه
orientation
decorative
الشيفرة
separator.tsx
import { Separator } from 'topclassui/separator'
<div className="flex min-h-5 flex-wrap items-center gap-3 text-sm text-body">
<span>Profile</span>
<Separator />
<span>Billing</span>
</div>يأخذ الفاصل العمودي ارتفاعه من صف flex أو grid؛ أعطِ الصف ارتفاعًا أو دعه يتمدد.
كل الحالات، بدون تمرير الفأرة
حالتانAccountSecurity
HorizontalDraftEdited 2 hours ago
Verticalأو استورده من الحزمة
topclassui/separator
import { Separator } from 'topclassui/separator'ثبّت مرة واحدة:npm i topclassui@beta zod
أمثلة
- لخط رفيع بين مجموعتين: أقسام نموذج، عناصر قائمة، معلومتين في صف واحد.
- لا هامش له، فالمسافة والحشوة في العنصر الأب هما ما يباعده.
- داخل عنصر أب كتلي يكون الفاصل العمودي بارتفاع 0 px: ضعه في صف flex أو grid.
- الخط حدّ بسماكة رمز عرض الخط، فيبقى ظاهرًا في وضع الألوان القسرية.
horizontal
Personal details
Name, email address and phone number.
horizontal.tsx
import { Separator } from 'topclassui/separator'
/** As in the docs sample, the gap of the column spaces the line, which has no margin of its own. */
export default function Demo() {
return (
<div className="flex flex-col gap-4">
<p className="text-base text-body">Personal details</p>
<Separator />
<p className="text-sm text-muted">Name, email address and phone number.</p>
</div>
)
}
vertical
DraftEdited 2 hours ago
vertical.tsx
import { Separator } from 'topclassui/separator'
/** The row has a height, and the line stretches to it although the row centres its items. */
export default function Demo() {
return (
<div className="flex h-5 items-center gap-3 text-sm text-body">
<span>Draft</span>
<Separator orientation="vertical" />
<span>Edited 2 hours ago</span>
</div>
)
}
semantic
Account settings
ProfileBilling
semantic.tsx
import { Separator } from 'topclassui/separator'
/** decorative={false}: each line is a separator a screen reader announces with its orientation. */
export default function Demo() {
return (
<div className="flex flex-col gap-4 text-sm text-body">
<p>Account settings</p>
<Separator decorative={false} />
<div className="flex h-5 items-center gap-3">
<span>Profile</span>
<Separator orientation="vertical" decorative={false} />
<span>Billing</span>
</div>
</div>
)
}
بالعربية، من اليمين إلى اليسار
البيانات الشخصية
مسودةعُدّلت قبل ساعتين
rtl.tsx
import { Separator } from 'topclassui/separator'
/** Right to left: the vertical line is the inline-start border, the right edge of its box here. */
export default function Demo() {
return (
<div dir="rtl" lang="ar" className="flex flex-col gap-4 text-sm text-body">
<p className="text-base">البيانات الشخصية</p>
<Separator />
<div className="flex h-5 items-center gap-3">
<span>مسودة</span>
<Separator orientation="vertical" />
<span>عُدّلت قبل ساعتين</span>
</div>
</div>
)
}
الخصائص
لوحة المفاتيح وإمكانية الوصول
لا شيء يُشغَّل: ليس تفاعليًا بمفرده.
- يُعرض افتراضيًا مع
role="none"ويبقى خارج شجرة إمكانية الوصول. - مرّر
decorative={false}حين يفصل محتوى ينبغي أن يُسمع منفصلًا: يصبحseparatorمعaria-orientation. - يستخدم الخط
--tc-line، وهو زخرفي ومستثنى من قاعدة تباين 3:1؛ لا تجعله وحده ما يفصل بين المعاني.
من اليمين إلى اليسار
الخط العمودي هو الحد عند بداية السطر في صندوقه، فينعكس مع الصفحة بلا أي صنف خاص بالاتجاه.
الخادم والمتصفح
يُعرض على الخادم ولا يرسل أي JavaScript.
الملفات: index.tsx.
على الشارة: server - 0 KB.