Inputs

Scoped Search

A three-part search group: where to look, what to look for, and the button — the order reads like a sentence, and the scope travels with the query.

  • inputgroup
  • search
  • scope
  • form

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/inputgroup-005?lang=en

Search the knowledge base

Область уходит вместе с запросом — ссылку на результат можно сохранить.

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 "inputgroup-005" (Scoped Search) 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/inputgroup-005.json

Registry item: https://vibeui.ru/r/inputgroup-005.json
Installs to: components/vibeui/inputgroup-005.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 three-part search group: where to look, what to look for, and the button — the order reads like a sentence, and the scope travels with the query.

A server-rendered three-part group: a scope select, the query field and the button in one capsule. The scope is submitted as its own form field. Zero dependencies, one file.

## 3. How to use it
import { Inputgroup005 } from "@/components/vibeui/inputgroup-005"

<Inputgroup005
  name="q"
  label="Search the knowledge base"
  scopes={["Everywhere", "In articles"]}
/>

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-inputgroup-005-* palette — do not swap it for your theme tokens
- the collapsed borders: neighbours carry a negative margin so the halves share one line instead of two
- raising the focused element with z-index — without it the neighbour's border clips half the ring
- the form with role="search": that is how assistive tech and the browser recognise a search
- the where–what–find order: the group has to read like a sentence
- the scope as its own form field: otherwise the result link cannot be saved

## 6. You may change
- the label copy and the scopes array
- the placeholder text and the button caption
- the name prop — the query and scope field names are built from it
- the accent through the accent prop

## 7. Rules
- The component does not search: attach action or onSubmit to the form.
- Three elements do not fit one row on a narrow screen — stack them or drop the button caption.
- Keep scopes short: long captions stretch the select and eat the query field.
- 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/inputgroup-005.json
https://vibeui.ru/r/inputgroup-005.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-inputgroup-005-*. Серверный: состояния нет, обёртка — <form role="search">, поэтому Enter отправляет запрос. Три элемента сцеплены схлопнутыми границами, скругление задано радиусом 999px и стоит только на концах — середина остаётся прямой. Область поиска уходит отдельным полем `${name}-scope`, поэтому ссылку на результат можно сохранить.

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 Inputgroup005Props = Omit<
  ComponentPropsWithoutRef<"form">,
  "children"
> & {
  name?: string
  label?: string
  scopes?: string[]
  placeholder?: string
  accent?: string
}

// Идея компонента: область поиска выбирается до запроса, а не фильтруется
// после. Слева select «где искать», в середине поле, справа кнопка — три
// элемента в одной рамке. Такой порядок не случаен: сначала «где», потом
// «что», потом «найти» — сцепка читается как фраза. Форма настоящая, поэтому
// Enter в поле отправляет запрос без единого обработчика клавиш.
const STYLES = `
:where([data-vibeui-block="inputgroup-005"]){
--vibeui-inputgroup-005-surface:oklch(1 0 0);
--vibeui-inputgroup-005-shell:oklch(0.91 0.006 265);
--vibeui-inputgroup-005-fg:oklch(0.23 0.014 265);
--vibeui-inputgroup-005-muted:oklch(0.55 0.014 265);
--vibeui-inputgroup-005-field:oklch(0.99 0.002 265);
--vibeui-inputgroup-005-fixed:oklch(0.955 0.004 265);
--vibeui-inputgroup-005-border:oklch(0.86 0.008 265);
--vibeui-inputgroup-005-accent:oklch(0.5 0.18 275);
--vibeui-inputgroup-005-radius:999px;
--vibeui-inputgroup-005-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="inputgroup-005"]{
display:flex;flex-direction:column;gap:0.5rem;margin:0;
width:100%;max-width:26rem;box-sizing:border-box;padding:0.875rem;
background:var(--vibeui-inputgroup-005-surface);
border:1px solid var(--vibeui-inputgroup-005-shell);border-radius:0.875rem;
font-family:var(--vibeui-inputgroup-005-font);color:var(--vibeui-inputgroup-005-fg);
}
[data-vibeui-block="inputgroup-005"] *{box-sizing:border-box}
[data-vibeui-block="inputgroup-005"] [data-part="title"]{font-size:0.8125rem;font-weight:600}
[data-vibeui-block="inputgroup-005"] [data-part="group"]{display:flex;align-items:stretch}
[data-vibeui-block="inputgroup-005"] [data-part="group"] > *{
position:relative;height:2.75rem;
border:1px solid var(--vibeui-inputgroup-005-border);
border-radius:0;margin-left:-1px;font:inherit;font-size:0.875rem;color:inherit;
}
/* Скруглены только концы сцепки — середина остаётся прямой. */
[data-vibeui-block="inputgroup-005"] [data-part="group"] > *:first-child{
margin-left:0;
border-radius:var(--vibeui-inputgroup-005-radius) 0 0 var(--vibeui-inputgroup-005-radius);
padding-left:1rem;
}
[data-vibeui-block="inputgroup-005"] [data-part="group"] > *:last-child{
border-radius:0 var(--vibeui-inputgroup-005-radius) var(--vibeui-inputgroup-005-radius) 0;
}
[data-vibeui-block="inputgroup-005"] [data-part="group"] > *:focus,
[data-vibeui-block="inputgroup-005"] [data-part="group"] > *:focus-visible{
z-index:1;outline:2px solid var(--vibeui-inputgroup-005-accent);outline-offset:-1px;
border-color:var(--vibeui-inputgroup-005-accent);
}
[data-vibeui-block="inputgroup-005"] select{
appearance:none;flex:none;cursor:pointer;
padding-right:1.5rem;
background:var(--vibeui-inputgroup-005-fixed);
font-weight:600;color:var(--vibeui-inputgroup-005-muted);
background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
background-position:calc(100% - 1rem) 50%,calc(100% - 0.7rem) 50%;
background-size:0.3rem 0.3rem,0.3rem 0.3rem;
background-repeat:no-repeat;
}
[data-vibeui-block="inputgroup-005"] input{
flex:1;min-width:0;padding:0 0.875rem;
background:var(--vibeui-inputgroup-005-field);
}
[data-vibeui-block="inputgroup-005"] button{
appearance:none;flex:none;cursor:pointer;
display:inline-flex;align-items:center;gap:0.375rem;padding:0 1.125rem;
background:var(--vibeui-inputgroup-005-accent);
border-color:var(--vibeui-inputgroup-005-accent);
color:oklch(1 0 0);font-weight:650;
transition:filter .16s ease;
}
[data-vibeui-block="inputgroup-005"] button:hover{filter:brightness(1.08)}
[data-vibeui-block="inputgroup-005"] button svg{width:0.9375rem;height:0.9375rem;display:block}
[data-vibeui-block="inputgroup-005"] [data-part="hint"]{
margin:0;font-size:0.75rem;line-height:1.4;color:var(--vibeui-inputgroup-005-muted);
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="inputgroup-005"] *{animation:none!important;transition:none!important}}
`

/**
 * Поиск с выбором области: select, поле и кнопка в одной сцепке.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Inputgroup005({
  name = "q",
  label = "Поиск по базе знаний",
  scopes = ["Везде", "В статьях", "В людях", "В задачах"],
  placeholder = "Что ищем?",
  accent,
  className,
  style,
  ...props
}: Inputgroup005Props) {
  const palette = {
    ...(accent ? { "--vibeui-inputgroup-005-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-inputgroup-005" precedence="medium">
        {STYLES}
      </style>
      <form
        {...props}
        role="search"
        data-vibeui-block="inputgroup-005"
        className={className}
        style={palette}
      >
        <span data-part="title" id={`${name}-title`}>
          {label}
        </span>
        <div data-part="group">
          <select
            name={`${name}-scope`}
            aria-label="Где искать"
            defaultValue={scopes[0]}
          >
            {scopes.map((scope) => (
              <option key={scope} value={scope}>
                {scope}
              </option>
            ))}
          </select>
          <input
            name={name}
            type="search"
            placeholder={placeholder}
            aria-labelledby={`${name}-title`}
            aria-describedby={`${name}-hint`}
          />
          <button type="submit">
            <svg
              viewBox="0 0 16 16"
              fill="none"
              stroke="currentColor"
              strokeWidth="1.8"
              aria-hidden="true"
            >
              <circle cx="7" cy="7" r="4.5" />
              <path d="m10.5 10.5 3 3" strokeLinecap="round" />
            </svg>
            Найти
          </button>
        </div>
        <p data-part="hint" id={`${name}-hint`}>
          Область уходит вместе с запросом — ссылку на результат можно
          сохранить.
        </p>
      </form>
    </>
  )
}