Feedback

Pill Toast

A confirmation the size of one line: a dark pill with a glyph, no heading, no buttons, no close — a remark rather than a message.

  • toast
  • snackbar
  • compact
  • confirmation

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/toast-010?lang=en

Link copied
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 "toast-010" (Pill Toast) 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/toast-010.json

Registry item: https://vibeui.ru/r/toast-010.json
Installs to: components/vibeui/toast-010.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 confirmation the size of one line: a dark pill with a glyph, no heading, no buttons, no close — a remark rather than a message.

A compact one-line confirmation pill: a glyph and text, nothing else. Zero dependencies, one file, no client JS.

## 3. How to use it
import { Toast010 } from "@/components/vibeui/toast-010"

<Toast010 message="Link copied" tone="success" glyph="✓" />

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-toast-010-* palette — do not swap it for your theme tokens
- the single ellipsised line: the pill is built for a remark, not an explanation
- the absence of buttons and a close control — there is nowhere to put an action, the pill leaves on its own
- role="status" with aria-live="polite": a confirmation must not interrupt reading
- disabling the animation on the block itself under prefers-reduced-motion, not only on its children
- the dark fill regardless of tone: a coloured pill fights the interface underneath it

## 6. You may change
- the copy through message and the tone through tone
- the glyph through glyph, or drop it with an empty string
- the maximum width through max-width
- the glyph colour through the --vibeui-toast-010-tone variable

## 7. Rules
- The component does not disappear by itself: the caller owns the timer.
- Text longer than the line is ellipsised — for two lines use a card, not a pill.
- The glyph is a character: your own icon replaces the content of glyph.
- 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/toast-010.json
https://vibeui.ru/r/toast-010.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-toast-010-*. Серверный: хуков нет. Форма и вес отличают пилюлю от карточек: скругление 9999px, одна строка с многоточием, ширина по содержимому. Появление — короткий подъём с масштабом; правило prefers-reduced-motion выключает его и для самого блока, а не только для потомков. Тон меняет только цвет значка: заливка остаётся тёмной, чтобы пилюля не спорила с интерфейсом.

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 Toast010Tone = "neutral" | "success" | "warning"

export type Toast010Props = Omit<
  ComponentPropsWithoutRef<"div">,
  "children"
> & {
  message?: string
  tone?: Toast010Tone
  /** Значок слева. Пустая строка убирает его. */
  glyph?: string
}

// Идея компонента: подтверждение размером в строку. Ни заголовка, ни кнопок,
// ни крестика — пилюля появляется, читается за долю секунды и уходит сама.
// Форма и вес отличают её от карточек: это реплика, а не сообщение.
const STYLES = `
:where([data-vibeui-block="toast-010"]){
--vibeui-toast-010-bg:oklch(0.21 0.014 265);
--vibeui-toast-010-fg:oklch(0.97 0.002 265);
--vibeui-toast-010-tone:oklch(0.78 0.13 152);
--vibeui-toast-010-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="toast-010"]{
display:inline-flex;align-items:center;gap:0.5rem;
max-width:22rem;box-sizing:border-box;
padding:0.5rem 0.9375rem 0.5rem 0.75rem;
border-radius:9999px;
background:var(--vibeui-toast-010-bg);color:var(--vibeui-toast-010-fg);
font-family:var(--vibeui-toast-010-font);font-size:0.8125rem;line-height:1.4;
box-shadow:0 16px 34px -20px oklch(0.15 0.02 265 / 70%);
animation:vibeui-toast-010-rise .26s cubic-bezier(.2,.8,.3,1) both;
}
[data-vibeui-block="toast-010"][data-tone="warning"]{--vibeui-toast-010-tone:oklch(0.82 0.15 85)}
[data-vibeui-block="toast-010"][data-tone="neutral"]{--vibeui-toast-010-tone:oklch(0.82 0.02 265)}
[data-vibeui-block="toast-010"] [data-part="glyph"]{
flex:none;display:flex;align-items:center;justify-content:center;
width:1.25rem;height:1.25rem;border-radius:9999px;
background:color-mix(in oklab,var(--vibeui-toast-010-tone) 24%,transparent);
color:var(--vibeui-toast-010-tone);
font-size:0.6875rem;font-weight:800;line-height:1;
}
[data-vibeui-block="toast-010"] [data-part="message"]{
min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:520;
}
@keyframes vibeui-toast-010-rise{
from{opacity:0;transform:translateY(0.625rem) scale(.96)}
to{opacity:1;transform:translateY(0) scale(1)}
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="toast-010"] *{animation:none!important;transition:none!important}}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="toast-010"]{animation:none!important}}
`

/**
 * Компактная пилюля-подтверждение: одна строка, без кнопок и заголовка.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Toast010({
  message = "Ссылка скопирована",
  tone = "success",
  glyph = "✓",
  className,
  style,
  ...props
}: Toast010Props) {
  return (
    <>
      <style href="vibeui-toast-010" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="toast-010"
        data-tone={tone}
        role="status"
        aria-live="polite"
        className={className}
        style={style as CSSProperties}
      >
        {glyph ? (
          <span data-part="glyph" aria-hidden="true">
            {glyph}
          </span>
        ) : null}
        <span data-part="message">{message}</span>
      </div>
    </>
  )
}