ContentDivider
Genel görünümimport { ContentDivider, ContentDividerAlign, ContentDividerSpacing, ContentDividerType } from '@nili/ui';Bu, kütüphanenin kendi genel görünüm sayfası — canlı olarak render ediliyor. Üstten dili veya temayı değiştirin, o da değişir.
Çizgiler
Çocuğu yoksa düz bir ayraçtır. spacing çevresindeki dikey boşluğu belirler; type adlandırılmış Figma ön ayarlarından birini seçer.
Üstte
Altta
Üstte
Altta
Üstte
Altta
Üstte
Altta
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" />
</>
)
}Metinle
Dize olan bir çocuk etiket olarak çizilir. text-and-line onu iki çizgi arasında ortalar; text başa yalnız koyar; solid-text dolu çipi verir.
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>
</>
)
}Hizalama
align içeriğin çizgi üzerinde nerede duracağını belirler. Mantıksaldır, start okuma yönünü izler.
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>
</>
)
}Denetimlerle
Dört düğme ön ayarı yalnızca çocuk olarak ne verdiğinizde ayrışır — kompakt bir düğme, bunlardan bir grup, metin düğmesi. Geometri aynı; adlar kurduğunuz duruma göredir.
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>
</>
)
}Dikey
Dikey yönelim bir satırdaki öğeleri ayırır — bir araç çubuğu, bir istatistik kümesi. Kapsayıcısının yüksekliğine uzar.
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' >
Varyant eksenleri — bileşenin cva tanımından
| Prop | Tip | Varsayılan | Notlar |
|---|---|---|---|
| spacing | none | sm | md | lg | none | |
| align | start | center | end | center | |
| orientation | horizontal | vertical | horizontal |
Diğer proplar
| Prop | Tip | Varsayılan | Notlar |
|---|---|---|---|
| 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
dahiliVaryant eksenleri — bileşenin cva tanımından
| Prop | Tip | Varsayılan | Notlar |
|---|---|---|---|
| variant | text | element | text |
ContentDividerRule
dahiliVaryant eksenleri — bileşenin cva tanımından
| Prop | Tip | Varsayılan | Notlar |
|---|---|---|---|
| orientation | horizontal | vertical | horizontal | |
| appearance | subtle | solid | subtle |