Accordion

Dense Accordion

A dense accordion with a value column on the right: a duration, a quantity or a price. A list like this is read down the right edge without opening anything.

  • accordion
  • list
  • dense
  • no-js

Preview

1440pxHost theme

Use it with AI

  1. 1. Copy the link.
  2. 2. Write to your agent in your own words and drop the link into the sentence.
  3. 3. The agent opens the link and installs the component from the registry.

put this in the header: https://vibeui.ru/c/accordion-004?lang=en

Разработка макета5 дней

Две итерации правок, готовые экраны для десктопа и мобильного, передача в вёрстку с описанием состояний.

Вёрстка и сборка7 дней

Сборка страниц из блоков, адаптив от 360 пикселей, проверка в актуальных браузерах и на реальных устройствах.

Наполнение контентом3 дня

Перенос текстов и изображений, оптимизация картинок, настройка мета-тегов и карточек для соцсетей.

Публикация и домен1 день

Подключение домена, сертификат, редиректы со старых адресов, подключение аналитики.

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 "accordion-004" (Dense Accordion) 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/accordion-004.json

Registry item: https://vibeui.ru/r/accordion-004.json
Installs to: components/vibeui/accordion-004.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 dense accordion with a value column on the right: a duration, a quantity or a price. A list like this is read down the right edge without opening anything.

A dense accordion list: a state arrow on the left, the title in the middle, a value on the right — duration, quantity or price. The values are set in tabular figures and line up in a column, so the list reads whole without opening a thing. An open row changes its background rather than its height. Zero dependencies, one file, its own palette, no client JS.

## 3. How to use it
import { Accordion004 } from "@/components/vibeui/accordion-004"

<Accordion004
  items={[{ title: "Build and assembly", meta: "7 days", body: "Pages assembled from blocks." }]}
/>

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-accordion-004-* palette — do not swap it for your theme tokens (bg-muted, text-muted-foreground and the like)
- the right-hand value column with font-variant-numeric:tabular-nums — it is why this variant exists; without the alignment it is just another accordion
- the arrow on the left: the right side is taken by the value, and the row's state has to be visible where the row begins
- the native details/summary instead of stateful buttons
- changing the open row's background rather than its height: in a dense list a jump loses the reading position
- white-space:nowrap on the value — wrapping "7 days" onto two lines breaks the column rhythm
- the focus-visible outline on summary: rows are tabbed through
- the <style> block inside the component — it holds the palette, the layout and the arrow

## 6. You may change
- the items array: title, the meta value and the body text
- defaultOpen — which row starts open; -1 closes them all
- the accent through the accent prop — it colours the open row's arrow and focus
- max width and outer spacing through className

## 7. Rules
- The values must be of one kind: mixing "7 days" and "€12,000" in one list does not read.
- This is not a table: there is no sorting and no column headers. If you need them, use table-001.
- Do not put a long phrase in meta — the column is sized for two or three words.
- 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/accordion-004.json
https://vibeui.ru/r/accordion-004.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-accordion-004-*. Раскрытие держат нативные <details>/<summary>. Стрелка стоит слева и поворачивается на 90° — она отмечает состояние строки, а не завершает её; правая колонка занята значением с tabular-nums, поэтому цифры выравниваются между строками. Открытая строка получает другую подложку, но не меняет высоту: список не прыгает при раскрытии.

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 Accordion004Item = {
  title: string
  /** Правая подпись в строке: срок, объём, цена. */
  meta?: string
  body: string
}

export type Accordion004Props = Omit<
  ComponentPropsWithoutRef<"div">,
  "children"
> & {
  items?: Accordion004Item[]
  defaultOpen?: number
  accent?: string
}

// Идея компонента: плотный список, где у каждой строки есть правая колонка —
// срок, объём, цена. Такой аккордеон читают глазами по правому краю, не
// раскрывая: значения выровнены моноширинными цифрами и стоят в столбик.
// Стрелка поворачивается, но строка не меняет высоту при открытии.
const STYLES = `
:where([data-vibeui-block="accordion-004"]){
--vibeui-accordion-004-fg:oklch(0.22 0.014 265);
--vibeui-accordion-004-muted:oklch(0.52 0.014 265);
--vibeui-accordion-004-bg:oklch(1 0 0);
--vibeui-accordion-004-alt:oklch(0.98 0.003 265);
--vibeui-accordion-004-border:oklch(0.91 0.006 265);
--vibeui-accordion-004-accent:oklch(0.55 0.2 262);
--vibeui-accordion-004-radius:0.75rem;
--vibeui-accordion-004-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
container-type:inline-size;
}
[data-vibeui-block="accordion-004"]{
display:flex;flex-direction:column;
width:100%;max-width:40rem;box-sizing:border-box;overflow:hidden;
border:1px solid var(--vibeui-accordion-004-border);
border-radius:var(--vibeui-accordion-004-radius);
background:var(--vibeui-accordion-004-bg);
color:var(--vibeui-accordion-004-fg);font-family:var(--vibeui-accordion-004-font);
}
[data-vibeui-block="accordion-004"] details + details{border-top:1px solid var(--vibeui-accordion-004-border)}
[data-vibeui-block="accordion-004"] details[open]{background:var(--vibeui-accordion-004-alt)}
[data-vibeui-block="accordion-004"] summary{
display:flex;align-items:center;gap:0.75rem;
padding:0.75rem 0.9375rem;cursor:pointer;list-style:none;
font-size:0.875rem;line-height:1.35;
}
[data-vibeui-block="accordion-004"] summary::-webkit-details-marker{display:none}
[data-vibeui-block="accordion-004"] summary:hover{background:color-mix(in oklab,var(--vibeui-accordion-004-border) 30%,transparent)}
[data-vibeui-block="accordion-004"] summary:focus-visible{outline:2px solid var(--vibeui-accordion-004-accent);outline-offset:-2px}
/* Стрелка слева: она отмечает состояние строки, а не завершает её. */
[data-vibeui-block="accordion-004"] [data-part="arrow"]{
flex:none;width:0.4375rem;height:0.4375rem;
border-right:1.5px solid var(--vibeui-accordion-004-muted);
border-bottom:1.5px solid var(--vibeui-accordion-004-muted);
transform:rotate(-45deg);
transition:transform .18s cubic-bezier(.32,.72,0,1),border-color .16s ease;
}
[data-vibeui-block="accordion-004"] details[open] [data-part="arrow"]{
transform:rotate(45deg);
border-right-color:var(--vibeui-accordion-004-accent);
border-bottom-color:var(--vibeui-accordion-004-accent);
}
[data-vibeui-block="accordion-004"] [data-part="title"]{flex:1 1 auto;min-width:0;font-weight:520}
/* Правый столбец: значения выровнены между строками, а не пляшут по ширине. */
[data-vibeui-block="accordion-004"] [data-part="meta"]{
flex:none;font-size:0.8125rem;color:var(--vibeui-accordion-004-muted);
font-variant-numeric:tabular-nums;white-space:nowrap;
}
[data-vibeui-block="accordion-004"] [data-part="body"]{
margin:0;padding:0 0.9375rem 0.875rem 2.125rem;
font-size:0.8125rem;line-height:1.6;color:var(--vibeui-accordion-004-muted);max-width:60ch;
}
@container (min-width: 30rem){
[data-vibeui-block="accordion-004"] summary{padding:0.875rem 1.125rem;font-size:0.9375rem}
[data-vibeui-block="accordion-004"] [data-part="body"]{padding:0 1.125rem 1rem 2.375rem;font-size:0.875rem}
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="accordion-004"] *{animation:none!important;transition:none!important}}
`

const DEFAULT_ITEMS: Accordion004Item[] = [
  {
    title: "Разработка макета",
    meta: "5 дней",
    body: "Две итерации правок, готовые экраны для десктопа и мобильного, передача в вёрстку с описанием состояний.",
  },
  {
    title: "Вёрстка и сборка",
    meta: "7 дней",
    body: "Сборка страниц из блоков, адаптив от 360 пикселей, проверка в актуальных браузерах и на реальных устройствах.",
  },
  {
    title: "Наполнение контентом",
    meta: "3 дня",
    body: "Перенос текстов и изображений, оптимизация картинок, настройка мета-тегов и карточек для соцсетей.",
  },
  {
    title: "Публикация и домен",
    meta: "1 день",
    body: "Подключение домена, сертификат, редиректы со старых адресов, подключение аналитики.",
  },
]

/**
 * Плотный аккордеон со значением справа: список читается не раскрывая.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Accordion004({
  items = DEFAULT_ITEMS,
  defaultOpen = 1,
  accent,
  className,
  style,
  ...props
}: Accordion004Props) {
  const palette = {
    ...(accent ? { "--vibeui-accordion-004-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-accordion-004" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="accordion-004"
        className={className}
        style={palette}
      >
        {items.map((item, index) => (
          <details key={item.title} open={index === defaultOpen}>
            <summary>
              <span data-part="arrow" aria-hidden="true" />
              <span data-part="title">{item.title}</span>
              {item.meta ? <span data-part="meta">{item.meta}</span> : null}
            </summary>
            <p data-part="body">{item.body}</p>
          </details>
        ))}
      </div>
    </>
  )
}