Display
Pill Label Divider
A divider whose caption sits in a pill carrying its own background: the page-coloured-text trick breaks on gradients, while a pill works on any surface.
- separator
- label
- divider
- pill
Preview
Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this in the header: https://vibeui.ru/c/separator-002?lang=en
Show the full instructions
What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.
# Install and place "separator-002" (Pill Label Divider) from VibeUI
## 1. Install first — do not skip, do not recreate
Run this exact command before writing any code:
npx shadcn@latest add https://vibeui.ru/r/separator-002.json
Registry item: https://vibeui.ru/r/separator-002.json
Installs to: components/vibeui/separator-002.tsx (the exact path follows this project's components.json aliases).
npm dependencies: none.
Registry dependencies: none.
Install it from the registry. Do not recreate it from the description,
do not substitute a similar component from another library, and do not
rewrite it to match the project's existing style.
## 2. What it is
A divider whose caption sits in a pill carrying its own background: the page-coloured-text trick breaks on gradients, while a pill works on any surface.
A divider with a pill caption: the position comes from grid columns and the pill carries its own fill. Zero dependencies, one file, no client JS.
## 3. How to use it
import { Separator002 } from "@/components/vibeui/separator-002"
<Separator002 label="or" align="center" />
Read the installed file for the full prop list.
## 4. Where to place it
This is a small inline component. Put it exactly where the user asked,
inside the existing markup. Do not create a new page, section or
wrapper for it. If a similar control already sits in that spot,
replace it instead of adding a second one.
Placement: ___
(The user fills this line in. If it is still blank, ask where to put it
instead of guessing.)
## 5. Keep exactly as installed
- the local --vibeui-separator-002-* palette — do not swap it for your theme tokens
- the pill's own fill: page-coloured text falls apart over a gradient or an image
- the grid columns instead of margins — the lines must meet the caption at any alignment
- role=separator with aria-label: without them the caption reads as ordinary text between blocks
- the uppercase and tracking of the caption: they mark it as a utility label, not a heading
- the thin pill border — on a light background the fill alone does not separate from the line
## 6. You may change
- the caption text and its length
- the caption position through align: start, center or end
- the line colour through the --vibeui-separator-002-line variable
- the divider width through max-width
## 7. Rules
- An empty label leaves an empty pill — use a plain divider in that case.
- The caption does not wrap: shorten long text rather than stretching the pill.
- role=separator without aria-orientation counts as horizontal — that is intended here.
- Do not lift the CSS variables into globals.css: the component has to stay a single file.
## 8. Verify
- it renders with no console errors;
- it looks like the preview on the VibeUI page you copied this from;
- if it does not, you changed something listed in section 5 — put it back.For developers
npx shadcn@latest add https://vibeui.ru/r/separator-002.jsonhttps://vibeui.ru/r/separator-002.jsonСерверный компонент, хуков нет. Положение подписи задаётся числом колонок сетки: center — 1fr auto 1fr, start — auto 1fr, end — 1fr auto, поэтому линии всегда упираются в пилюлю без ручных отступов. Пилюля несёт свою заливку и рамку — популярный приём «закрасить текст цветом страницы» рассыпается на градиенте и на картинке, где подпись оказывается в прямоугольнике чужого цвета. У корня role=separator и aria-label с текстом подписи, так что граница слышна и названа. Пилюля светлая с тёмным текстом, поэтому подложка компоненту не нужна.
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
import type { ComponentPropsWithoutRef, CSSProperties } from "react"
export type Separator002Props = Omit<
ComponentPropsWithoutRef<"div">,
"children"
> & {
label?: string
align?: "start" | "center" | "end"
}
// Идея компонента: подпись разделителя в «пилюле», которая сама несёт фон.
// Приём с текстом, закрашенным цветом страницы, ломается на градиенте и на
// картинке: подпись оказывается в прямоугольнике чужого цвета. Пилюля со
// своей заливкой и рамкой работает на любой подложке. Положение подписи
// задаётся числом колонок сетки, а не отступами — линии всегда сходятся.
const STYLES = `
:where([data-vibeui-block="separator-002"]){
--vibeui-separator-002-line:oklch(0.88 0.006 265);
--vibeui-separator-002-pill:oklch(0.98 0.002 265);
--vibeui-separator-002-fg:oklch(0.35 0.014 265);
--vibeui-separator-002-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="separator-002"]{
display:grid;align-items:center;gap:0.625rem;
width:100%;max-width:24rem;box-sizing:border-box;
font-family:var(--vibeui-separator-002-font);
}
/* Положение подписи — это число колонок, а не отступы: линии всегда сходятся. */
[data-vibeui-block="separator-002"][data-align="center"]{grid-template-columns:1fr auto 1fr}
[data-vibeui-block="separator-002"][data-align="start"]{grid-template-columns:auto 1fr}
[data-vibeui-block="separator-002"][data-align="end"]{grid-template-columns:1fr auto}
[data-vibeui-block="separator-002"] [data-part="line"]{
height:1px;background:var(--vibeui-separator-002-line);
}
/* Пилюля несёт свой фон: приём «текст цвета страницы» рвётся на градиенте. */
[data-vibeui-block="separator-002"] [data-part="pill"]{
padding:0.1875rem 0.625rem;border-radius:9999px;
background:var(--vibeui-separator-002-pill);
border:1px solid var(--vibeui-separator-002-line);
color:var(--vibeui-separator-002-fg);
font-size:0.6875rem;font-weight:650;letter-spacing:0.04em;text-transform:uppercase;
white-space:nowrap;
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="separator-002"] *{animation:none!important;transition:none!important}}
`
/**
* Разделитель с подписью в пилюле: слева, по центру или справа.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Separator002({
label = "или",
align = "center",
className,
style,
...props
}: Separator002Props) {
return (
<>
<style href="vibeui-separator-002" precedence="medium">
{STYLES}
</style>
<div
{...props}
data-vibeui-block="separator-002"
data-align={align}
role="separator"
aria-label={label}
className={className}
style={style as CSSProperties}
>
{align === "start" ? null : <span data-part="line" />}
<span data-part="pill">{label}</span>
{align === "end" ? null : <span data-part="line" />}
</div>
</>
)
}