nili/ui
كل المكوّنات

ContentDivider

عرض شامل
١٢ تصدير٦ محور تنويع١٠ خاصيّة٣ ملف
import { ContentDivider, ContentDividerAlign, ContentDividerSpacing, ContentDividerType } from '@nili/ui';

هذه صفحة العرض الشامل الخاصة بالمكتبة، معروضة حيّة. غيّر اللغة أو السمة من الأعلى وسَتتبعك.

الخطوط

بلا أبناء يكون مجرّد فاصل. يضبط spacing المساحة الرأسية حوله، ويختار type أحد إعدادات فيجما المسمّاة.

spacing=none

أعلى

أسفل

spacing=sm

أعلى

أسفل

spacing=md

أعلى

أسفل

spacing=lg

أعلى

أسفل

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 شريحة معبّأة.

text-and-line
OR
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>
    </>
  )
}

مع عناصر تحكّم

لا تختلف إعدادات الأزرار الأربعة إلا فيما تمرّره كأبناء — زر مدمج أو مجموعة منها أو زر نصّي. الهندسة واحدة، والتسمية للحالة التي تبنيها.

icon-button
icon-button-group
text-button
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>
    </>
  )
}

رأسي

يفصل الاتجاه الرأسي العناصر في صفّ — شريط أدوات أو مجموعة إحصاءات. ويمتد إلى ارتفاع حاويته.

12 open4 closed2 draft
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>
  )
}