Display
Exclusive Steps
A group of disclosures where exactly one step stays open: mutual exclusion comes from the details name attribute, with no React state.
- collapsible
- steps
- exclusive
- no-js
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/collapsible-005?lang=en
Подключить реестр
Добавьте адрес реестра в components.json — после этого CLI видит компоненты по короткому имени.
Установить компонент
Команда кладёт один файл в components/vibeui и ничего больше не трогает: зависимостей у него нет.
Подставить свои данные
Пропсы описаны в metadata: подмените тексты и массивы, разметку и палитру оставьте как есть.
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 "collapsible-005" (Exclusive Steps) 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/collapsible-005.json
Registry item: https://vibeui.ru/r/collapsible-005.json
Installs to: components/vibeui/collapsible-005.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 group of disclosures where exactly one step stays open: mutual exclusion comes from the details name attribute, with no React state.
A group of disclosures with one open at a time: exclusion comes from the details name attribute, step numbers from a CSS counter. No client JS. Zero dependencies, one file.
## 3. How to use it
import { Collapsible005 } from "@/components/vibeui/collapsible-005"
<Collapsible005 steps={[{ label: "Connect the registry", text: "Add the URL to components.json", open: true }]} />
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-collapsible-005-* palette — do not swap it for your theme tokens
- the shared name attribute on details — that is the mutual exclusion, no separate state needed
- the CSS counter for numbering: reordering the array cannot desynchronise it
- highlighting the open step via details[open] rather than a class pushed from JS
- the text indent under the number: the column sets the top-down reading direction
- the light card surface — dark text is invisible on a dark showcase without it
## 6. You may change
- the steps array and the initial step through its open flag
- the radio group name through the groupName prop
- the accent through the accent prop
- the block width and corner radii
## 7. Rules
- The group name must be unique on the page: two blocks sharing groupName will close each other.
- Every step can end up closed by clicking the open one — that is details radio behaviour, not a bug.
- There is no switch animation: the browser closes the previous details instantly.
- 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/collapsible-005.jsonhttps://vibeui.ru/r/collapsible-005.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-collapsible-005-*. Серверный: хуков нет. Общий атрибут name на всех details превращает их в радиогруппу — открытым остаётся только один, и состояние не дублируется в React. Номер шага рисует CSS-счётчик на summary::before, поэтому перестановка массива steps сразу меняет нумерацию. Открытый шаг подсвечивается заливкой кружка через селектор details[open].
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 Collapsible005Step = {
label: string
text: string
open?: boolean
}
export type Collapsible005Props = Omit<
ComponentPropsWithoutRef<"div">,
"children"
> & {
steps?: Collapsible005Step[]
groupName?: string
accent?: string
}
// Идея компонента: группа свёрток, где открыт ровно один шаг. Взаимное
// исключение держит атрибут name у details — общее имя делает их радиогруппой,
// поэтому состояние не дублируется в React и работает до гидратации. Слева
// пронумерованная колонка: у мастера настройки важен порядок, а не только
// сам факт раскрытия.
const STYLES = `
:where([data-vibeui-block="collapsible-005"]){
--vibeui-collapsible-005-bg:oklch(1 0 0);
--vibeui-collapsible-005-fg:oklch(0.24 0.014 265);
--vibeui-collapsible-005-muted:oklch(0.56 0.014 265);
--vibeui-collapsible-005-border:oklch(0.9 0.006 265);
--vibeui-collapsible-005-accent:oklch(0.54 0.19 285);
--vibeui-collapsible-005-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="collapsible-005"]{
display:flex;flex-direction:column;
box-sizing:border-box;width:100%;max-width:25rem;padding:0.375rem;
background:var(--vibeui-collapsible-005-bg);color:var(--vibeui-collapsible-005-fg);
border:1px solid var(--vibeui-collapsible-005-border);border-radius:1rem;
font-family:var(--vibeui-collapsible-005-font);
counter-reset:vibeui-step;
}
[data-vibeui-block="collapsible-005"] details+details{border-top:1px solid var(--vibeui-collapsible-005-border)}
[data-vibeui-block="collapsible-005"] summary{
display:flex;align-items:center;gap:0.75rem;
padding:0.6875rem 0.75rem;cursor:pointer;list-style:none;border-radius:0.75rem;
font-size:0.875rem;font-weight:640;
}
[data-vibeui-block="collapsible-005"] summary::-webkit-details-marker{display:none}
[data-vibeui-block="collapsible-005"] summary:focus-visible{outline:2px solid var(--vibeui-collapsible-005-accent);outline-offset:-2px}
/* Номер шага рисует счётчик: переставили массив — нумерация поехала следом. */
[data-vibeui-block="collapsible-005"] summary::before{
counter-increment:vibeui-step;content:counter(vibeui-step);
flex:none;display:grid;place-items:center;
width:1.5rem;height:1.5rem;border-radius:9999px;
border:1px solid var(--vibeui-collapsible-005-border);
font-size:0.6875rem;font-weight:700;color:var(--vibeui-collapsible-005-muted);
transition:background-color .18s ease,color .18s ease,border-color .18s ease;
}
[data-vibeui-block="collapsible-005"] details[open] summary::before{
background:var(--vibeui-collapsible-005-accent);border-color:transparent;color:oklch(1 0 0);
}
[data-vibeui-block="collapsible-005"] [data-part="mark"]{
flex:none;margin-left:auto;width:0.4375rem;height:0.4375rem;
border-right:2px solid var(--vibeui-collapsible-005-muted);
border-bottom:2px solid var(--vibeui-collapsible-005-muted);
transform:rotate(-45deg);transform-origin:60% 60%;transition:transform .18s ease;
}
[data-vibeui-block="collapsible-005"] details[open] [data-part="mark"]{transform:rotate(45deg)}
[data-vibeui-block="collapsible-005"] [data-part="body"]{
margin:0;padding:0 0.75rem 0.875rem 3rem;
font-size:0.8125rem;line-height:1.55;color:var(--vibeui-collapsible-005-muted);
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="collapsible-005"] *{animation:none!important;transition:none!important}}
`
const DEFAULT_STEPS: Collapsible005Step[] = [
{
label: "Подключить реестр",
text: "Добавьте адрес реестра в components.json — после этого CLI видит компоненты по короткому имени.",
open: true,
},
{
label: "Установить компонент",
text: "Команда кладёт один файл в components/vibeui и ничего больше не трогает: зависимостей у него нет.",
},
{
label: "Подставить свои данные",
text: "Пропсы описаны в metadata: подмените тексты и массивы, разметку и палитру оставьте как есть.",
},
]
/**
* Группа свёрток с одной открытой за раз: взаимное исключение держит атрибут
* name у details. Один файл, ноль зависимостей, клиентского кода нет.
*/
export function Collapsible005({
steps = DEFAULT_STEPS,
groupName = "vibeui-collapsible-005",
accent,
className,
style,
...props
}: Collapsible005Props) {
const palette = {
...(accent ? { "--vibeui-collapsible-005-accent": accent } : null),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-collapsible-005" precedence="medium">
{STYLES}
</style>
<div
{...props}
data-vibeui-block="collapsible-005"
className={className}
style={palette}
>
{steps.map((step) => (
<details key={step.label} name={groupName} open={step.open}>
<summary>
{step.label}
<span data-part="mark" aria-hidden="true" />
</summary>
<p data-part="body">{step.text}</p>
</details>
))}
</div>
</>
)
}