Charts
Conversion Funnel
A symmetrical funnel with a real shape: every step is a clip-path trapezoid, the slope between steps is the loss, and the step-to-step rate is spelled out.
- funnel
- conversion
- clip-path
- analytics
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/chart-017?lang=en
- Открыли каталог12400
↓ переход 58% · потеря 5250
- Открыли компонент7150
↓ переход 42% · потеря 4130
- Нажали Copy for AI3020
↓ переход 42% · потеря 1760
- Установили1260
↓ переход 43% · потеря 720
- Вернулись за вторым540
Единица измерения: people per week. Ширина ступени — доля от первого шага.
| Открыли каталог | 12400 | 100% от первого шага |
|---|---|---|
| Открыли компонент | 7150 | 58% от первого шага |
| Нажали Copy for AI | 3020 | 24% от первого шага |
| Установили | 1260 | 10% от первого шага |
| Вернулись за вторым | 540 | 4% от первого шага |
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 "chart-017" (Conversion Funnel) 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/chart-017.json
Registry item: https://vibeui.ru/r/chart-017.json
Installs to: components/vibeui/chart-017.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 symmetrical funnel with a real shape: every step is a clip-path trapezoid, the slope between steps is the loss, and the step-to-step rate is spelled out.
A conversion funnel in symmetrical trapezoids: a step's top width is its share of the first step, its bottom width is the next step's share, and between the steps the pass-through rate and the absolute loss are printed. The data is mirrored in a hidden table. Zero dependencies, one file, no client JS.
## 3. How to use it
import { Chart017 } from "@/components/vibeui/chart-017"
<Chart017
title="Install funnel"
unit="people per week"
steps={[{ label: "Opened the catalog", value: 12400 }]}
/>
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-chart-017-* palette — do not swap it for your theme tokens (bg-card, --chart-1 and the like)
- the clip-path trapezoid: the slope between steps is the loss, and rectangles cannot show it
- the pass-through rate between steps — that is what says where people are lost
- absolute numbers beside the percentages: a 40% drop from twenty people means nothing
- the minimum step width: a near-zero step must not vanish from the picture
- the hidden table with shares of the first step — a funnel with no text alternative is inaccessible
## 6. You may change
- the steps array: a label and a value per step
- title — the funnel heading
- unit — the unit named in the caption under the funnel
- the accent through the accent prop — the base colour of the steps, each next one lighter
- the step height and outer spacing through className
## 7. Rules
- Steps must descend: a funnel that grows in the middle means broken data, not growth.
- Beyond six steps a funnel stops reading: merge adjacent stages.
- The component shows one snapshot and computes no period conversion.
- 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/chart-017.jsonhttps://vibeui.ru/r/chart-017.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-chart-017-*. Серверный: хуков нет. Форма ступени целиком живёт в clip-path: polygon, координаты углов приходят четырьмя CSS-переменными из доли шага и доли следующего шага, поэтому фигура тянется вместе с контейнером и не требует ни SVG, ни псевдоэлементов с бордерами. Ширина ступени ограничена снизу двенадцатью процентами, чтобы последний шаг не схлопнулся в линию. Данные продублированы визуально скрытой таблицей.
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 Chart017Step = {
label: string
value: number
}
export type Chart017Props = Omit<
ComponentPropsWithoutRef<"figure">,
"children" | "title"
> & {
title?: string
steps?: Chart017Step[]
unit?: string
accent?: string
}
// Идея компонента: симметричная воронка настоящей формы. Каждая ступень —
// трапеция на clip-path: верх шире низа ровно настолько, насколько упало
// значение, поэтому скос между шагами и есть потеря. Между ступенями
// подписан процент перехода — цифра, ради которой воронку и рисуют.
const STYLES = `
:where([data-vibeui-block="chart-017"]){
--vibeui-chart-017-bg:oklch(1 0 0);
--vibeui-chart-017-fg:oklch(0.22 0.014 265);
--vibeui-chart-017-muted:oklch(0.55 0.014 265);
--vibeui-chart-017-border:oklch(0.91 0.006 265);
--vibeui-chart-017-accent:oklch(0.55 0.17 285);
--vibeui-chart-017-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="chart-017"]{
display:flex;flex-direction:column;gap:0.5rem;
width:100%;max-width:24rem;box-sizing:border-box;margin:0;padding:0.875rem;
background:var(--vibeui-chart-017-bg);
border:1px solid var(--vibeui-chart-017-border);border-radius:0.875rem;
color:var(--vibeui-chart-017-fg);font-family:var(--vibeui-chart-017-font);
}
[data-vibeui-block="chart-017"] [data-part="title"]{margin:0;font-size:0.875rem;font-weight:650}
[data-vibeui-block="chart-017"] ol{display:flex;flex-direction:column;margin:0;padding:0;list-style:none}
[data-vibeui-block="chart-017"] [data-part="step"]{display:flex;flex-direction:column}
/* Трапеция целиком живёт в clip-path: никакого SVG и никаких псевдоэлементов
с бордерами, поэтому фигура тянется вместе с контейнером. */
[data-vibeui-block="chart-017"] [data-part="slab"]{
display:flex;align-items:center;justify-content:center;gap:0.5rem;
height:2.75rem;color:oklch(1 0 0);font-size:0.8125rem;font-weight:600;
background:var(--vibeui-chart-017-slab);
clip-path:polygon(var(--vibeui-chart-017-tl) 0%,var(--vibeui-chart-017-tr) 0%,var(--vibeui-chart-017-br) 100%,var(--vibeui-chart-017-bl) 100%);
}
[data-vibeui-block="chart-017"] [data-part="count"]{font-variant-numeric:tabular-nums;opacity:0.85}
[data-vibeui-block="chart-017"] [data-part="drop"]{
display:flex;align-items:center;justify-content:center;gap:0.375rem;
padding:0.1875rem 0;font-size:0.6875rem;color:var(--vibeui-chart-017-muted);
font-variant-numeric:tabular-nums;
}
[data-vibeui-block="chart-017"] [data-part="unit"]{margin:0;font-size:0.75rem;color:var(--vibeui-chart-017-muted)}
[data-vibeui-block="chart-017"] [data-part="data"]{
position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;
clip-path:inset(50%);white-space:nowrap;border:0;
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="chart-017"] *{animation:none!important;transition:none!important}}
`
const DEFAULT_STEPS: Chart017Step[] = [
{ label: "Открыли каталог", value: 12_400 },
{ label: "Открыли компонент", value: 7_150 },
{ label: "Нажали Copy for AI", value: 3_020 },
{ label: "Установили", value: 1_260 },
{ label: "Вернулись за вторым", value: 540 },
]
/**
* Воронка конверсии симметричными трапециями с процентом перехода.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Chart017({
title = "Воронка установки",
steps = DEFAULT_STEPS,
unit = "человек за неделю",
accent,
className,
style,
...props
}: Chart017Props) {
const first = steps[0]?.value || 1
const palette = {
...(accent ? { "--vibeui-chart-017-accent": accent } : null),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-chart-017" precedence="medium">
{STYLES}
</style>
<figure
{...props}
data-vibeui-block="chart-017"
className={className}
style={palette}
>
<figcaption data-part="title">{title}</figcaption>
<ol>
{steps.map((step, index) => {
const next = steps[index + 1]
// Минимум в 12 % ширины: нулевая ступень не должна схлопываться
// в линию, иначе последний шаг исчезает с картинки.
const topShare = Math.max(step.value / first, 0.12)
const bottomShare = Math.max(
(next?.value ?? step.value) / first,
0.12,
)
const edges = {
"--vibeui-chart-017-tl": `${((1 - topShare) / 2) * 100}%`,
"--vibeui-chart-017-tr": `${((1 + topShare) / 2) * 100}%`,
"--vibeui-chart-017-bl": `${((1 - bottomShare) / 2) * 100}%`,
"--vibeui-chart-017-br": `${((1 + bottomShare) / 2) * 100}%`,
"--vibeui-chart-017-slab": `color-mix(in oklab,var(--vibeui-chart-017-accent) ${100 - index * 13}%,oklch(0.72 0.05 285))`,
} as CSSProperties
return (
<li key={step.label} data-part="step">
<div data-part="slab" style={edges}>
<span>{step.label}</span>
<span data-part="count">{step.value}</span>
</div>
{next ? (
<p data-part="drop">
↓ переход {Math.round((next.value / step.value) * 100)}% ·
потеря {step.value - next.value}
</p>
) : null}
</li>
)
})}
</ol>
<p data-part="unit">
Единица измерения: {unit}. Ширина ступени — доля от первого шага.
</p>
<table data-part="data">
<caption>
{title}, {unit}
</caption>
<tbody>
{steps.map((step) => (
<tr key={step.label}>
<th scope="row">{step.label}</th>
<td>{step.value}</td>
<td>
{Math.round((step.value / first) * 100)}% от первого шага
</td>
</tr>
))}
</tbody>
</table>
</figure>
</>
)
}