ContentDivider
عرض شاملimport { ContentDivider, ContentDividerAlign, ContentDividerSpacing, ContentDividerType } from '@nili/ui';هذه صفحة العرض الشامل الخاصة بالمكتبة، معروضة حيّة. غيّر اللغة أو السمة من الأعلى وسَتتبعك.
الخطوط
بلا أبناء يكون مجرّد فاصل. يضبط spacing المساحة الرأسية حوله، ويختار type أحد إعدادات فيجما المسمّاة.
أعلى
أسفل
أعلى
أسفل
أعلى
أسفل
أعلى
أسفل
import { ContentDivider } from "@nili/ui"
export function Example() {
return (
<>
<ContentDivider type="line" />
<ContentDivider type="line-spacing" />
{/* the same thing, spelled as the axis */}
<ContentDivider spacing="none" />
<ContentDivider spacing="md" />
</>
)
}مع نص
يُرسم الابن النصّي كتسمية. يضعه text-and-line في الوسط بين خطّين، ويضعه text وحده في البداية، ويمنحه solid-text شريحة معبّأة.
import { ContentDivider } from "@nili/ui"
export function Example() {
return (
<>
<ContentDivider type="text-and-line">{t('text.or')}</ContentDivider>
<ContentDivider type="text">{t('text.today')}</ContentDivider>
<ContentDivider type="solid-text">
{t('text.newMessages')}
</ContentDivider>
</>
)
}المحاذاة
يحدّد align موضع المحتوى على الخط. وهو منطقي، فـstart يتبع اتجاه القراءة.
import { ContentDivider } from "@nili/ui"
export function Example() {
return (
<>
<ContentDivider align="start" spacing="sm">Start</ContentDivider>
<ContentDivider align="center" spacing="sm">Center</ContentDivider>
<ContentDivider align="end" spacing="sm">End</ContentDivider>
</>
)
}مع عناصر تحكّم
لا تختلف إعدادات الأزرار الأربعة إلا فيما تمرّره كأبناء — زر مدمج أو مجموعة منها أو زر نصّي. الهندسة واحدة، والتسمية للحالة التي تبنيها.
import { ContentDivider, Button, CompactButton, Icon } from "@nili/ui"
import { RiAddLine, RiMore2Fill } from "@remixicon/react"
export function Example() {
return (
<>
<ContentDivider type="icon-button">
<CompactButton
appearance="stroke"
fullRadius
aria-label={t('controls.add')}
>
<Icon icon={RiAddLine} />
</CompactButton>
</ContentDivider>
<ContentDivider type="text-button">
<Button size="2xs" appearance="stroke">Show more</Button>
</ContentDivider>
</>
)
}رأسي
يفصل الاتجاه الرأسي العناصر في صفّ — شريط أدوات أو مجموعة إحصاءات. ويمتد إلى ارتفاع حاويته.
import { ContentDivider } from "@nili/ui"
export function Example() {
return (
<div className="flex h-10 items-center gap-3">
<span>{t('vertical.open')}</span>
<ContentDivider orientation="vertical" />
<span>{t('vertical.closed')}</span>
<ContentDivider orientation="vertical" />
<span>{t('vertical.draft')}</span>
</div>
)
}ContentDivider
extends Omit< ComponentPropsWithoutRef<'div'>, 'children' >
محاور التنويع — من تعريف cva للمكوّن
| الخاصيّة | النوع | الافتراضي | ملاحظات |
|---|---|---|---|
| spacing | none | sm | md | lg | none | |
| align | start | center | end | center | |
| orientation | horizontal | vertical | horizontal |
باقي الخصائص
| الخاصيّة | النوع | الافتراضي | ملاحظات |
|---|---|---|---|
| children | ReactNode | — | Text, a Button, a ButtonGroup — anything. Omit for a plain rule. |
| aria-label | string | — | |
| appearance | subtle | solid | — | `solid` is the stronger rule Figma uses for "Solid Text Divider". |
| type | line | line-spacing | text-and-line | text | solid-text | icon-button | icon-button-group | text-button | text-button-group | — | Figma `🧩 Type`. A shorthand that sets `spacing`, `align` and `appearance` together; anything you pass explicitly still wins, so the preset is a floor rather than a ceiling. |
ContentDividerContent
داخليمحاور التنويع — من تعريف cva للمكوّن
| الخاصيّة | النوع | الافتراضي | ملاحظات |
|---|---|---|---|
| variant | text | element | text |
ContentDividerRule
داخليمحاور التنويع — من تعريف cva للمكوّن
| الخاصيّة | النوع | الافتراضي | ملاحظات |
|---|---|---|---|
| orientation | horizontal | vertical | horizontal | |
| appearance | subtle | solid | subtle |