Display
Changed Settings
A settings disclosure with a changed marker: the number of values differing from the defaults is visible before you expand it.
- collapsible
- settings
- diff
- details
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-008?lang=en
Build options2 изменено
- Формат сборки
- standalone
- Кеш реестра
- 1 час
- Тема превью
- auto
- Порог предупреждений
- 12
- Телеметрия
- выключена
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-008" (Changed Settings) 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-008.json
Registry item: https://vibeui.ru/r/collapsible-008.json
Installs to: components/vibeui/collapsible-008.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 settings disclosure with a changed marker: the number of values differing from the defaults is visible before you expand it.
A collapsed settings group that states how many values differ from the defaults: a counter in the header, a dot and a bolder value in the rows. No client JS. Zero dependencies, one file.
## 3. How to use it
import { Collapsible008 } from "@/components/vibeui/collapsible-008"
<Collapsible008 title="Build options" settings={[{ label: "Format", value: "standalone", changed: 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-008-* palette — do not swap it for your theme tokens
- the change counter in the header: a collapsed block otherwise hides that anything was edited
- the dl/dt/dd markup — these are name/value pairs, not a table
- the double change cue (a dot plus a stronger value): colour alone fails for colour blindness
- the monospaced values: they get compared character by character
- the light card surface — dark text is invisible on a dark showcase without it
## 6. You may change
- the heading through the title prop
- the settings array and its changed flags
- the wording of the counter badge
- the accent through the accent prop
## 7. Rules
- The component does not diff anything itself: the changed flag comes from outside.
- There is deliberately no reset button: that is an action, and this block stays a view.
- Long values do not wrap — add wrapping or shorten the text if your values are long.
- 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-008.jsonhttps://vibeui.ru/r/collapsible-008.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-collapsible-008-*. Серверный: хуков нет, корень — details. Количество изменённых параметров считается из массива settings по флагу changed и выводится плашкой в summary; при нуле плашка меняет текст и приглушается через атрибут data-clean. Строки собраны на dl/dt/dd — это описания значений, а не таблица; изменённая строка получает точку в dt::before, подложку и жирное моноширинное значение.
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 Collapsible008Setting = {
label: string
value: string
changed?: boolean
}
export type Collapsible008Props = Omit<
ComponentPropsWithoutRef<"details">,
"children" | "title"
> & {
title?: string
settings?: Collapsible008Setting[]
accent?: string
}
// Идея компонента: свёрнутая группа настроек с признаком «изменено».
// Свёрнутый блок скрывает не только значения, но и сам факт правки, поэтому
// количество отличий от значений по умолчанию считается из данных и висит в
// заголовке. Внутри изменённая строка помечена точкой и жирным значением —
// глаз ловит отличие раньше, чем читает подпись.
const STYLES = `
:where([data-vibeui-block="collapsible-008"]){
--vibeui-collapsible-008-bg:oklch(1 0 0);
--vibeui-collapsible-008-fg:oklch(0.24 0.014 265);
--vibeui-collapsible-008-muted:oklch(0.56 0.014 265);
--vibeui-collapsible-008-border:oklch(0.9 0.006 265);
--vibeui-collapsible-008-accent:oklch(0.62 0.16 55);
--vibeui-collapsible-008-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
--vibeui-collapsible-008-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;
}
[data-vibeui-block="collapsible-008"]{
display:block;box-sizing:border-box;width:100%;max-width:25rem;
background:var(--vibeui-collapsible-008-bg);color:var(--vibeui-collapsible-008-fg);
border:1px solid var(--vibeui-collapsible-008-border);border-radius:1rem;
font-family:var(--vibeui-collapsible-008-font);
}
[data-vibeui-block="collapsible-008"] summary{
display:flex;align-items:center;gap:0.625rem;
padding:0.8125rem 0.875rem;cursor:pointer;list-style:none;border-radius:1rem;
font-size:0.875rem;font-weight:650;
}
[data-vibeui-block="collapsible-008"] summary::-webkit-details-marker{display:none}
[data-vibeui-block="collapsible-008"] summary:focus-visible{outline:2px solid var(--vibeui-collapsible-008-accent);outline-offset:-2px}
/* Счётчик отличий в заголовке: свёрнутый блок иначе скрывает сам факт правки. */
[data-vibeui-block="collapsible-008"] [data-part="tally"]{
margin-left:auto;display:inline-flex;align-items:center;gap:0.375rem;
padding:0.125rem 0.5rem;border-radius:9999px;
background:color-mix(in oklab,var(--vibeui-collapsible-008-accent) 16%,transparent);
color:var(--vibeui-collapsible-008-accent);
font-size:0.6875rem;font-weight:700;
}
[data-vibeui-block="collapsible-008"] [data-part="tally"][data-clean="true"]{
background:oklch(0.55 0.02 265 / 10%);color:var(--vibeui-collapsible-008-muted);
}
[data-vibeui-block="collapsible-008"] [data-part="mark"]{
flex:none;width:0.4375rem;height:0.4375rem;
border-right:2px solid var(--vibeui-collapsible-008-muted);
border-bottom:2px solid var(--vibeui-collapsible-008-muted);
transform:rotate(-45deg);transform-origin:60% 60%;transition:transform .18s ease;
}
[data-vibeui-block="collapsible-008"][open] [data-part="mark"]{transform:rotate(45deg)}
[data-vibeui-block="collapsible-008"] dl{
margin:0;padding:0.375rem 0.5rem 0.625rem;
border-top:1px solid var(--vibeui-collapsible-008-border);
}
[data-vibeui-block="collapsible-008"] [data-part="row"]{
display:flex;align-items:center;gap:0.75rem;
padding:0.4375rem 0.5rem;border-radius:0.625rem;
}
[data-vibeui-block="collapsible-008"] [data-part="row"][data-changed="true"]{
background:color-mix(in oklab,var(--vibeui-collapsible-008-accent) 8%,transparent);
}
[data-vibeui-block="collapsible-008"] dt{
display:flex;align-items:center;gap:0.5rem;
font-size:0.8125rem;color:var(--vibeui-collapsible-008-muted);
}
[data-vibeui-block="collapsible-008"] dt::before{
content:"";flex:none;width:0.375rem;height:0.375rem;border-radius:9999px;
background:transparent;
}
[data-vibeui-block="collapsible-008"] [data-part="row"][data-changed="true"] dt::before{
background:var(--vibeui-collapsible-008-accent);
}
[data-vibeui-block="collapsible-008"] dd{
margin:0 0 0 auto;
font-family:var(--vibeui-collapsible-008-mono);font-size:0.75rem;
color:var(--vibeui-collapsible-008-muted);
}
[data-vibeui-block="collapsible-008"] [data-part="row"][data-changed="true"] dd{
color:var(--vibeui-collapsible-008-fg);font-weight:700;
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="collapsible-008"] *{animation:none!important;transition:none!important}}
`
const DEFAULT_SETTINGS: Collapsible008Setting[] = [
{ label: "Формат сборки", value: "standalone", changed: true },
{ label: "Кеш реестра", value: "1 час" },
{ label: "Тема превью", value: "auto" },
{ label: "Порог предупреждений", value: "12", changed: true },
{ label: "Телеметрия", value: "выключена" },
]
/**
* Свёртка настроек с признаком «изменено»: счётчик отличий в заголовке,
* точка и жирное значение в строках. Один файл, ноль зависимостей.
*/
export function Collapsible008({
title = "Параметры сборки",
settings = DEFAULT_SETTINGS,
accent,
className,
style,
...props
}: Collapsible008Props) {
const changed = settings.filter((setting) => setting.changed).length
const palette = {
...(accent ? { "--vibeui-collapsible-008-accent": accent } : null),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-collapsible-008" precedence="medium">
{STYLES}
</style>
<details
{...props}
data-vibeui-block="collapsible-008"
className={className}
style={palette}
>
<summary>
{title}
<span data-part="tally" data-clean={changed === 0}>
{changed === 0 ? "по умолчанию" : `${changed} изменено`}
</span>
<span data-part="mark" aria-hidden="true" />
</summary>
<dl>
{settings.map((setting) => (
<div
key={setting.label}
data-part="row"
data-changed={Boolean(setting.changed)}
>
<dt>{setting.label}</dt>
<dd>{setting.value}</dd>
</div>
))}
</dl>
</details>
</>
)
}