Display

Shortcut Hint Bar

A row of shortcut hints for a bottom status bar: the key-action pairs never break across lines, because a split hint is useless.

  • kbd
  • hints
  • footer
  • shortcuts

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/kbd-004?lang=en

перемещениевыбратьKпоискEscзакрыть
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 "kbd-004" (Shortcut Hint Bar) 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/kbd-004.json

Registry item: https://vibeui.ru/r/kbd-004.json
Installs to: components/vibeui/kbd-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 row of shortcut hints for a bottom status bar: the key-action pairs never break across lines, because a split hint is useless.

A status bar of hints: key-action pairs on one line, wrapping only as whole pairs. Zero dependencies, one file, no client JS.

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

<Kbd004
  hints={[{ keys: ["↑", "↓"], action: "navigate" }, { keys: ["↵"], action: "select" }]}
  align="between"
  size="sm"
/>

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-kbd-004-* palette — do not swap it for your theme tokens
- nowrap on the pair: a split hint like "↵ select" stops meaning anything
- the absence of borders around pairs — with them the status bar reads as a button panel
- the kbd tag for keys: a screen reader announces them as input, not as symbols
- the small type size: the bar is read peripherally and must not compete with the content
- the component's own light surface: the bar is dark and disappears on a dark background

## 6. You may change
- the bar alignment through align: start, center or between
- the density through size: sm or md
- the hint set through hints
- the bar width through max-width

## 7. Rules
- Nobody reads more than five hints in a bar — keep the important ones.
- The between alignment leaves large gaps on narrow widths: check it on a phone.
- The bar is not interactive: use real buttons if a hint has to be clickable.
- 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/kbd-004.json
https://vibeui.ru/r/kbd-004.json

Серверный компонент, хуков нет. Полоса читается боковым зрением, поэтому подсказки разделены только промежутком: рамка вокруг каждой пары превращает служебную строку в панель кнопок. Каждая пара помечена white-space:nowrap, так что при нехватке ширины полоса переносит подсказки целиком, а не рвёт «↵ выбрать» пополам. Выравнивание переключается атрибутом data-align (start, center, between), плотность — data-size. Клавиши набраны тегом kbd. Подложка светлая, потому что вся полоса набрана тёмным.

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 Kbd004Hint = { keys: string[]; action: string }

export type Kbd004Props = Omit<ComponentPropsWithoutRef<"div">, "children"> & {
  hints?: Kbd004Hint[]
  align?: "start" | "center" | "between"
  size?: "sm" | "md"
}

// Идея компонента: строка подсказок внизу окна или списка. Она читается
// боковым зрением, поэтому подсказки разделены только промежутком, а не
// рамками: рамка вокруг каждой пары превращает служебную полосу в панель
// кнопок. Полоса переносится целыми подсказками, а сама пара «клавиша —
// действие» переноса не допускает: разорванная подсказка бесполезна.
const STYLES = `
:where([data-vibeui-block="kbd-004"]){
--vibeui-kbd-004-surface:oklch(1 0 0);
--vibeui-kbd-004-fg:oklch(0.3 0.014 265);
--vibeui-kbd-004-muted:oklch(0.56 0.014 265);
--vibeui-kbd-004-border:oklch(0.89 0.008 265);
--vibeui-kbd-004-key:oklch(0.97 0.003 265);
--vibeui-kbd-004-gap:0.875rem;
--vibeui-kbd-004-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
/* Своя светлая подложка: полоса подсказок набрана тёмным. */
[data-vibeui-block="kbd-004"]{
display:flex;align-items:center;flex-wrap:wrap;
gap:0.375rem var(--vibeui-kbd-004-gap);
width:100%;max-width:34rem;box-sizing:border-box;padding:0.5rem 0.875rem;
background:var(--vibeui-kbd-004-surface);
border:1px solid var(--vibeui-kbd-004-border);border-radius:0.75rem;
font-family:var(--vibeui-kbd-004-font);color:var(--vibeui-kbd-004-fg);
font-size:0.75rem;
}
[data-vibeui-block="kbd-004"][data-align="center"]{justify-content:center}
[data-vibeui-block="kbd-004"][data-align="between"]{justify-content:space-between}
[data-vibeui-block="kbd-004"][data-size="md"]{font-size:0.8125rem;--vibeui-kbd-004-gap:1.25rem}
/* Пара «клавиша — действие» не переносится: разорванная подсказка бесполезна. */
[data-vibeui-block="kbd-004"] [data-part="hint"]{
display:inline-flex;align-items:center;gap:0.375rem;white-space:nowrap;
}
[data-vibeui-block="kbd-004"] [data-part="keys"]{display:inline-flex;align-items:center;gap:0.1875rem}
[data-vibeui-block="kbd-004"] kbd{
display:inline-flex;align-items:center;justify-content:center;
min-width:1.25rem;height:1.25rem;padding:0 0.3125rem;box-sizing:border-box;
background:var(--vibeui-kbd-004-key);
border:1px solid var(--vibeui-kbd-004-border);border-radius:0.3125rem;
font-family:inherit;font-size:0.6875rem;font-weight:650;line-height:1;
}
[data-vibeui-block="kbd-004"] [data-part="action"]{color:var(--vibeui-kbd-004-muted)}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="kbd-004"] *{animation:none!important;transition:none!important}}
`

const DEFAULT_HINTS: Kbd004Hint[] = [
  { keys: ["↑", "↓"], action: "перемещение" },
  { keys: ["↵"], action: "выбрать" },
  { keys: ["⌘", "K"], action: "поиск" },
  { keys: ["Esc"], action: "закрыть" },
]

/**
 * Ряд подсказок горячих клавиш для нижней служебной полосы.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Kbd004({
  hints = DEFAULT_HINTS,
  align = "start",
  size = "sm",
  className,
  style,
  ...props
}: Kbd004Props) {
  return (
    <>
      <style href="vibeui-kbd-004" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="kbd-004"
        data-align={align}
        data-size={size}
        className={className}
        style={style as CSSProperties}
      >
        {hints.map((hint) => (
          <span key={hint.action} data-part="hint">
            <span data-part="keys">
              {hint.keys.map((key) => (
                <kbd key={key}>{key}</kbd>
              ))}
            </span>
            <span data-part="action">{hint.action}</span>
          </span>
        ))}
      </div>
    </>
  )
}