Code Block

Prompt Line

A single terminal line instead of a code block: the prompt and the blinking caret are drawn in CSS, so only the command itself gets copied.

  • terminal
  • prompt
  • command
  • shell

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

~/projects/vibeuimain

npx shadcn@latest add codeblock-004

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 "codeblock-004" (Prompt Line) 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/codeblock-004.json

Registry item: https://vibeui.ru/r/codeblock-004.json
Installs to: components/vibeui/codeblock-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 single terminal line instead of a code block: the prompt and the blinking caret are drawn in CSS, so only the command itself gets copied.

A terminal line with a prompt, working directory, branch and a blinking caret. The prompt is not copied, zero dependencies, no client JS.

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

<Codeblock004
  command="npm run dev"
  prompt="$"
  cwd="~/projects/vibeui"
  branch="main"
/>

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-codeblock-004-* palette — do not swap it for your theme tokens
- the prompt in ::before: put in the markup it lands in the clipboard and breaks the pasted command
- user-select:none on the prompt — otherwise a double click grabs the dollar sign
- the prefers-reduced-motion rule: a blinking caret is an irritant for some people
- the directory and branch line: a command without a "where" invites running it in the wrong place
- the dark surface with a green border — it makes the block a terminal, not a paragraph of code

## 6. You may change
- the command through command
- the prompt sign through prompt
- the directory through cwd and the branch through branch
- the prompt colour and the caret blink rate

## 7. Rules
- The block is built for one command: for a sequence use a list of lines, not a wrap inside one.
- The caret is decorative and hidden from screen readers: there is no real input here.
- An empty branch removes its chip — the normal state outside a git repository.
- 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/codeblock-004.json
https://vibeui.ru/r/codeblock-004.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-codeblock-004-*. Серверный: хуков нет. Приглашение печатается ::before через content:attr(data-prompt) и помечено user-select:none, поэтому выделение строки отдаёт в буфер команду без символа $. Над командой стоит служебная строка с текущим каталогом и веткой — она объясняет, где команду выполняют. Каретка мигает keyframes-анимацией со steps(1), у блока есть правило 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 Codeblock004Props = Omit<
  ComponentPropsWithoutRef<"div">,
  "children"
> & {
  command?: string
  prompt?: string
  cwd?: string
  branch?: string
}

// Идея компонента: одна строка терминала, а не блок кода. Приглашение и
// каретка нарисованы псевдоэлементами, поэтому выделяется и копируется
// только сама команда — приглашение в буфер не уезжает.
const STYLES = `
:where([data-vibeui-block="codeblock-004"]){
--vibeui-codeblock-004-bg:oklch(0.16 0.012 160);
--vibeui-codeblock-004-fg:oklch(0.93 0.02 160);
--vibeui-codeblock-004-muted:oklch(0.64 0.03 160);
--vibeui-codeblock-004-prompt:oklch(0.82 0.16 148);
--vibeui-codeblock-004-branch:oklch(0.82 0.12 85);
--vibeui-codeblock-004-border:oklch(0.82 0.16 148 / 26%);
--vibeui-codeblock-004-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;
}
[data-vibeui-block="codeblock-004"]{
display:block;width:100%;max-width:30rem;box-sizing:border-box;
padding:0.75rem 0.9375rem;
border:1px solid var(--vibeui-codeblock-004-border);border-radius:0.625rem;
background:var(--vibeui-codeblock-004-bg);color:var(--vibeui-codeblock-004-fg);
font-family:var(--vibeui-codeblock-004-mono);font-size:0.8125rem;line-height:1.6;
}
[data-vibeui-block="codeblock-004"] [data-part="where"]{
display:flex;flex-wrap:wrap;align-items:baseline;gap:0.5rem;
margin-bottom:0.25rem;font-size:0.75rem;color:var(--vibeui-codeblock-004-muted);
}
[data-vibeui-block="codeblock-004"] [data-part="branch"]{color:var(--vibeui-codeblock-004-branch)}
[data-vibeui-block="codeblock-004"] [data-part="branch"]::before{content:"⎇ ";opacity:.7}
[data-vibeui-block="codeblock-004"] [data-part="line"]{
display:flex;align-items:baseline;gap:0.5rem;margin:0;
}
/* Приглашение — псевдоэлемент: копируется только команда. */
[data-vibeui-block="codeblock-004"] [data-part="line"]::before{
content:attr(data-prompt);flex:none;
color:var(--vibeui-codeblock-004-prompt);font-weight:700;
user-select:none;-webkit-user-select:none;
}
[data-vibeui-block="codeblock-004"] code{
font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;
}
[data-vibeui-block="codeblock-004"] [data-part="caret"]{
display:inline-block;width:0.5rem;height:1em;
margin-inline-start:0.25rem;vertical-align:-0.15em;
background:var(--vibeui-codeblock-004-prompt);
animation:vibeui-codeblock-004-blink 1.1s steps(1,end) infinite;
}
@keyframes vibeui-codeblock-004-blink{0%,50%{opacity:1}50.01%,100%{opacity:0}}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="codeblock-004"] *{animation:none!important;transition:none!important}}
`

/** Строка терминала с приглашением и мигающей кареткой. */
export function Codeblock004({
  command = "npx shadcn@latest add codeblock-004",
  prompt = "$",
  cwd = "~/projects/vibeui",
  branch = "main",
  className,
  style,
  ...props
}: Codeblock004Props) {
  return (
    <>
      <style href="vibeui-codeblock-004" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="codeblock-004"
        className={className}
        style={style as CSSProperties}
      >
        <div data-part="where">
          <span>{cwd}</span>
          {branch ? <span data-part="branch">{branch}</span> : null}
        </div>
        <p data-part="line" data-prompt={prompt}>
          <code>{command}</code>
          <span data-part="caret" aria-hidden="true" />
        </p>
      </div>
    </>
  )
}