Display

Row With Action

A row with its own button on the right: a stretched link is impossible here, so the button stays a separate target and carries the row title in its label.

  • item
  • list
  • row
  • action

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/item-003?lang=en

  • Maria Kovalevamaria@studio.ru · читатель
  • 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 "item-003" (Row With Action) 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/item-003.json
    
    Registry item: https://vibeui.ru/r/item-003.json
    Installs to: components/vibeui/item-003.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 row with its own button on the right: a stretched link is impossible here, so the button stays a separate target and carries the row title in its label.
    
    A list row with a text block on the left and an action button on the right. Zero dependencies, one file, no state.
    
    ## 3. How to use it
    import { Item003 } from "@/components/vibeui/item-003"
    
    <Item003 title="Maria Kovaleva" action="Invite" />
    
    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-item-003-* palette — do not swap it for your theme tokens
    - the button as its own target: a stretched link would cover it and make it unreachable
    - the button aria-label carrying the row title — otherwise ten "Invite" buttons are indistinguishable
    - flex:none on the button: a squeezed action label reads worse than a clipped description
    - the visible focus ring on the button — it is the only interactive target in the row
    - the li element: rows belong in a list, not a pile of divs
    
    ## 6. You may change
    - title and meta — the title and the secondary text
    - action — the button label
    - the accent through the accent prop
    - the row width
    
    ## 7. Rules
    - The button handler is not part of the component: pass onClick from the caller.
    - The row does not assume two or more actions — an action menu needs its own block.
    - Wrap the rows in a <ul>: a lone li outside a list is invalid.
    - 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/item-003.json
    https://vibeui.ru/r/item-003.json

    Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-item-003-*. Серверный: состояния нет, обработчик вешает вызывающий код через проп onClick. Раскладка — флекс из текстового блока и кнопки; кнопка помечена flex:none и не сжимается, текст обрезается многоточием. aria-label кнопки собирается из действия и названия строки, поэтому десять одинаковых кнопок подряд различимы на слух.

    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 Item003Props = Omit<
      ComponentPropsWithoutRef<"li">,
      "children" | "title"
    > & {
      title?: string
      meta?: string
      action?: string
      accent?: string
    }
    
    // Идея компонента: строка с действием справа. Здесь нельзя растягивать ссылку
    // на всю площадь, как в item-001: у строки две цели — сама запись и кнопка,
    // и растянутая ссылка перекрыла бы кнопку. Поэтому кнопка остаётся отдельной
    // целью, а её подпись несёт название записи для скринридера: десять кнопок
    // «Пригласить» подряд неразличимы на слух.
    const STYLES = `
    :where([data-vibeui-block="item-003"]){
    --vibeui-item-003-bg:oklch(1 0 0);
    --vibeui-item-003-fg:oklch(0.23 0.014 265);
    --vibeui-item-003-muted:oklch(0.56 0.014 265);
    --vibeui-item-003-border:oklch(0.9 0.006 265);
    --vibeui-item-003-accent:oklch(0.55 0.19 262);
    --vibeui-item-003-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
    }
    [data-vibeui-block="item-003"]{
    display:flex;align-items:center;gap:0.75rem;
    width:100%;max-width:24rem;box-sizing:border-box;padding:0.625rem 0.625rem 0.625rem 0.875rem;
    list-style:none;
    background:var(--vibeui-item-003-bg);
    border:1px solid var(--vibeui-item-003-border);border-radius:0.75rem;
    font-family:var(--vibeui-item-003-font);color:var(--vibeui-item-003-fg);
    }
    [data-vibeui-block="item-003"] *{box-sizing:border-box}
    [data-vibeui-block="item-003"] [data-part="text"]{flex:1 1 auto;min-width:0;display:grid;gap:0.125rem}
    [data-vibeui-block="item-003"] [data-part="title"]{
    font-size:0.875rem;font-weight:650;line-height:1.3;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
    }
    [data-vibeui-block="item-003"] [data-part="meta"]{
    font-size:0.75rem;line-height:1.35;color:var(--vibeui-item-003-muted);
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
    }
    /* Кнопка не сжимается: её подпись важнее подробностей строки. */
    [data-vibeui-block="item-003"] [data-part="action"]{
    flex:none;appearance:none;cursor:pointer;
    height:1.875rem;padding:0 0.75rem;border-radius:0.5rem;
    border:1px solid color-mix(in oklab,var(--vibeui-item-003-accent) 45%,transparent);
    background:color-mix(in oklab,var(--vibeui-item-003-accent) 10%,transparent);
    color:var(--vibeui-item-003-accent);
    font:inherit;font-size:0.75rem;font-weight:650;line-height:1;
    transition:background-color .15s ease;
    }
    [data-vibeui-block="item-003"] [data-part="action"]:hover{background:color-mix(in oklab,var(--vibeui-item-003-accent) 18%,transparent)}
    [data-vibeui-block="item-003"] [data-part="action"]:focus-visible{outline:2px solid var(--vibeui-item-003-accent);outline-offset:2px}
    @media (prefers-reduced-motion:reduce){[data-vibeui-block="item-003"] *{animation:none!important;transition:none!important}}
    `
    
    /**
     * Строка списка с отдельной кнопкой действия справа.
     * Один файл, ноль зависимостей, собственная палитра.
     */
    export function Item003({
      title = "Мария Ковалёва",
      meta = "maria@studio.ru · читатель",
      action = "Пригласить",
      accent,
      className,
      style,
      ...props
    }: Item003Props) {
      const palette = {
        ...(accent ? { "--vibeui-item-003-accent": accent } : null),
        ...style,
      } as CSSProperties
    
      return (
        <>
          <style href="vibeui-item-003" precedence="medium">
            {STYLES}
          </style>
          <li
            {...props}
            data-vibeui-block="item-003"
            className={className}
            style={palette}
          >
            <span data-part="text">
              <span data-part="title">{title}</span>
              {meta ? <span data-part="meta">{meta}</span> : null}
            </span>
            <button
              type="button"
              data-part="action"
              aria-label={`${action}: ${title}`}
            >
              {action}
            </button>
          </li>
        </>
      )
    }