Feedback

Bottom Sheet

A bottom sheet on the native dialog: the page stays visible above its top edge — that is what separates a sheet from a full-screen modal.

  • sheet
  • mobile
  • dialog
  • checkout

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/sheet-001?lang=en

Your order

Товары
12 480 ₽
Доставка
390 ₽
Скидка
−1 200 ₽
Итого
11 670 ₽
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 "sheet-001" (Bottom Sheet) 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/sheet-001.json

Registry item: https://vibeui.ru/r/sheet-001.json
Installs to: components/vibeui/sheet-001.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 bottom sheet on the native dialog: the page stays visible above its top edge — that is what separates a sheet from a full-screen modal.

A bottom sheet: a grabber, a heading, a label–value summary and two large buttons. Zero dependencies, one file.

## 3. How to use it
import { Sheet001 } from "@/components/vibeui/sheet-001"

<Sheet001 triggerLabel="Show order" rows={rows} primaryLabel="Checkout" />

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-sheet-001-* palette — do not swap it for your theme tokens
- the height cap: the page must remain visible above the sheet
- the grabber — it promises the sheet can be dismissed by gesture
- env(safe-area-inset-bottom) in the bottom padding
- 2.75rem buttons: a sheet lives under the thumb
- @starting-style, or the sheet appears abruptly

## 6. You may change
- triggerLabel, title and rows
- primaryLabel — the main action
- the sheet's max height
- the accent through the accent prop

## 7. Rules
- Drag-to-dismiss is not implemented: the grabber promises it, add a handler if you need it.
- A bottom sheet is wrong on desktop: use a dialog or a side panel there.
- The summary is not for long lists: scrolling inside a sheet is awkward.
- 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/sheet-001.json
https://vibeui.ru/r/sheet-001.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-sheet-001-*. Клиентский: "use client" — нужен ref для showModal и close. Высота ограничена min(28rem, 85dvh), нижний отступ учитывает env(safe-area-inset-bottom). Выезд снизу сделан переходом translate с @starting-style. Сводка выложена словарём dl.

Component source

The same file your agent installs. Here in case you would rather copy it by hand.

"use client"

import { useRef } from "react"
import type { ComponentPropsWithoutRef, CSSProperties } from "react"

export type Sheet001Props = Omit<
  ComponentPropsWithoutRef<"div">,
  "children" | "title"
> & {
  triggerLabel?: string
  title?: string
  rows?: { label: string; value: string }[]
  primaryLabel?: string
  accent?: string
}

// Идея компонента: лист, выезжающий снизу, на нативном dialog. Он занимает
// не весь экран: за верхним краем видно страницу, и это единственное, что
// отличает лист от полноэкранного окна. Ручка сверху — не декор: за неё
// тянут, и она обещает, что лист можно закрыть жестом.
const STYLES = `
:where([data-vibeui-block="sheet-001"]){
--vibeui-sheet-001-bg:oklch(1 0 0);
--vibeui-sheet-001-fg:oklch(0.22 0.014 265);
--vibeui-sheet-001-muted:oklch(0.56 0.014 265);
--vibeui-sheet-001-border:oklch(0.9 0.006 265);
--vibeui-sheet-001-accent:oklch(0.55 0.17 265);
--vibeui-sheet-001-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="sheet-001"]{
display:inline-block;font-family:var(--vibeui-sheet-001-font);color:var(--vibeui-sheet-001-fg);
}
[data-vibeui-block="sheet-001"] [data-part="trigger"]{
appearance:none;cursor:pointer;
height:2.25rem;padding:0 0.875rem;
border:1px solid var(--vibeui-sheet-001-border);border-radius:0.625rem;
background:var(--vibeui-sheet-001-bg);color:inherit;
font:inherit;font-size:0.8125rem;font-weight:600;
}
[data-vibeui-block="sheet-001"] [data-part="trigger"]:focus-visible{outline:2px solid var(--vibeui-sheet-001-accent);outline-offset:2px}
/* Лист не во весь экран: за верхним краем видно страницу. */
[data-vibeui-block="sheet-001"] dialog{
position:fixed;inset:auto 0 0 0;
width:100%;max-width:100vw;max-height:min(28rem,85dvh);
margin:0;padding:0;border:0;
border-radius:1.125rem 1.125rem 0 0;
background:var(--vibeui-sheet-001-bg);color:inherit;
box-shadow:0 -24px 60px -30px oklch(0.2 0.02 265 / 55%);
translate:0 100%;transition:translate .22s ease,overlay .22s allow-discrete,display .22s allow-discrete;
}
[data-vibeui-block="sheet-001"] dialog[open]{translate:0 0}
@starting-style{
[data-vibeui-block="sheet-001"] dialog[open]{translate:0 100%}
}
[data-vibeui-block="sheet-001"] dialog::backdrop{background:oklch(0.2 0.02 265 / 45%)}
[data-vibeui-block="sheet-001"] [data-part="panel"]{
display:flex;flex-direction:column;gap:0.625rem;box-sizing:border-box;
padding:0.5rem 1rem calc(1rem + env(safe-area-inset-bottom,0px));
}
/* Ручка обещает жест: без неё лист выглядит окном, приклеенным к низу. */
[data-vibeui-block="sheet-001"] [data-part="grabber"]{
align-self:center;width:2.5rem;height:0.25rem;margin:0.25rem 0 0.375rem;
border-radius:9999px;background:var(--vibeui-sheet-001-border);
}
[data-vibeui-block="sheet-001"] [data-part="title"]{margin:0;font-size:1rem;font-weight:680}
[data-vibeui-block="sheet-001"] dl{
display:grid;grid-template-columns:auto 1fr;gap:0.375rem 0.75rem;margin:0;font-size:0.875rem;
}
[data-vibeui-block="sheet-001"] [data-part="row"]{display:contents}
[data-vibeui-block="sheet-001"] dt{color:var(--vibeui-sheet-001-muted)}
[data-vibeui-block="sheet-001"] dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}
[data-vibeui-block="sheet-001"] [data-part="foot"]{display:flex;gap:0.5rem;margin-top:0.25rem}
[data-vibeui-block="sheet-001"] [data-part="foot"] button{
appearance:none;cursor:pointer;flex:1;
height:2.75rem;border-radius:0.75rem;
border:1px solid var(--vibeui-sheet-001-border);
background:transparent;color:inherit;font:inherit;font-size:0.9375rem;font-weight:650;
}
[data-vibeui-block="sheet-001"] [data-part="foot"] button[data-primary="true"]{
border-color:transparent;background:var(--vibeui-sheet-001-accent);color:oklch(0.99 0.01 265);
}
@media (prefers-reduced-motion:reduce){
[data-vibeui-block="sheet-001"] dialog{transition:none!important;translate:0 0}
}
`

const DEFAULT_ROWS = [
  { label: "Товары", value: "12 480 ₽" },
  { label: "Доставка", value: "390 ₽" },
  { label: "Скидка", value: "−1 200 ₽" },
  { label: "Итого", value: "11 670 ₽" },
]

/**
 * Лист снизу на нативном dialog: ручка, сводка и крупные кнопки.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Sheet001({
  triggerLabel = "Показать заказ",
  title = "Ваш заказ",
  rows = DEFAULT_ROWS,
  primaryLabel = "Оформить",
  accent,
  className,
  style,
  ...props
}: Sheet001Props) {
  const sheet = useRef<HTMLDialogElement>(null)

  const palette = {
    ...(accent ? { "--vibeui-sheet-001-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-sheet-001" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="sheet-001"
        className={className}
        style={palette}
      >
        <button
          type="button"
          data-part="trigger"
          onClick={() => sheet.current?.showModal()}
        >
          {triggerLabel}
        </button>
        <dialog ref={sheet} aria-label={title}>
          <div data-part="panel">
            <span data-part="grabber" aria-hidden="true" />
            <h2 data-part="title">{title}</h2>
            <dl>
              {rows.map((row) => (
                <div key={row.label} data-part="row">
                  <dt>{row.label}</dt>
                  <dd>{row.value}</dd>
                </div>
              ))}
            </dl>
            <div data-part="foot">
              <button type="button" onClick={() => sheet.current?.close()}>
                Закрыть
              </button>
              <button
                type="button"
                data-primary="true"
                onClick={() => sheet.current?.close()}
              >
                {primaryLabel}
              </button>
            </div>
          </div>
        </dialog>
      </div>
    </>
  )
}