Inputs
Range Pair
A range as two attached fields: "from" and "to" with a drawn dash between them, wrapped in a fieldset with a shared caption.
- inputgroup
- range
- fieldset
- filter
Preview
Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this in the header: https://vibeui.ru/c/inputgroup-006?lang=en
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-006" (Range Pair) 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-006.json
Registry item: https://vibeui.ru/r/inputgroup-006.json
Installs to: components/vibeui/inputgroup-006.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 range as two attached fields: "from" and "to" with a drawn dash between them, wrapped in a fieldset with a shared caption.
A server-rendered range group: a fieldset with a shared caption, two fields and a drawn dash between them, each half its own form field. Zero dependencies, one file.
## 3. How to use it
import { Inputgroup006 } from "@/components/vibeui/inputgroup-006"
<Inputgroup006
name="price"
legend="Price, $"
from={1500}
to={9000}
/>
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-006-* 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 fieldset with a legend: this is one value in two parts and must read as "Price, from" and "Price, to"
- float:left and clear:both on the legend: inside a flex container the next child otherwise wraps around it
- the dash as its own aria-hidden element: it is not announced and there is nothing to click on it
## 6. You may change
- the legend caption and the unit sign
- the starting from and to values
- the hint text under the group
- the accent through the accent prop
## 7. Rules
- The component does not enforce from < to — validate that on submit.
- An empty half means "no limit": do not fill it with a zero.
- The ∞ placeholder in the second half is decoration, not a value: it never reaches the server.
- 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-006.jsonhttps://vibeui.ru/r/inputgroup-006.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-inputgroup-006-*. Серверный: состояния нет. Обёртка — fieldset с legend, потому что это одна величина из двух частей. legend во flex-контейнере ведёт себя как отдельный поток, поэтому у него float:left;width:100%, а следующему ребёнку задан clear:both. Тире — отдельный элемент сцепки с aria-hidden, а не текст внутри поля. Обе половины уходят полями `${name}-from` и `${name}-to`.
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 Inputgroup006Props = Omit<
ComponentPropsWithoutRef<"fieldset">,
"children"
> & {
name?: string
legend?: string
unit?: string
from?: number
to?: number
hint?: string
accent?: string
}
// Идея компонента: два поля «от» и «до» в одной рамке с тире между ними.
// Обёртка — fieldset с legend, потому что это одна величина из двух частей:
// screen reader прочитает «Цена, от» и «Цена, до», а не два безымянных числа.
// Тире — не текст внутри поля, а отдельный неинтерактивный элемент с
// aria-hidden: озвучивать его незачем, а кликать по нему нечего.
const STYLES = `
:where([data-vibeui-block="inputgroup-006"]){
--vibeui-inputgroup-006-surface:oklch(1 0 0);
--vibeui-inputgroup-006-shell:oklch(0.91 0.006 265);
--vibeui-inputgroup-006-fg:oklch(0.22 0.014 265);
--vibeui-inputgroup-006-muted:oklch(0.55 0.014 265);
--vibeui-inputgroup-006-field:oklch(0.99 0.002 265);
--vibeui-inputgroup-006-border:oklch(0.86 0.008 265);
--vibeui-inputgroup-006-accent:oklch(0.52 0.16 55);
--vibeui-inputgroup-006-radius:0.75rem;
--vibeui-inputgroup-006-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="inputgroup-006"]{
display:flex;flex-direction:column;gap:0.5rem;
width:100%;max-width:21rem;box-sizing:border-box;
margin:0;padding:0.875rem;
background:var(--vibeui-inputgroup-006-surface);
border:1px solid var(--vibeui-inputgroup-006-shell);border-radius:0.875rem;
font-family:var(--vibeui-inputgroup-006-font);color:var(--vibeui-inputgroup-006-fg);
}
[data-vibeui-block="inputgroup-006"] *{box-sizing:border-box}
/* legend во flex-контейнере ведёт себя как отдельный поток: возвращаем его
в строку, иначе следующий ребёнок обтекает подпись. */
[data-vibeui-block="inputgroup-006"] legend{
float:left;width:100%;padding:0;margin:0 0 0.5rem;
font-size:0.8125rem;font-weight:600;
}
[data-vibeui-block="inputgroup-006"] legend + *{clear:both}
[data-vibeui-block="inputgroup-006"] [data-part="group"]{display:flex;align-items:stretch}
[data-vibeui-block="inputgroup-006"] [data-part="group"] > *{
position:relative;height:2.75rem;
border:1px solid var(--vibeui-inputgroup-006-border);
border-radius:0;margin-left:-1px;font:inherit;color:inherit;
background:var(--vibeui-inputgroup-006-field);
}
[data-vibeui-block="inputgroup-006"] [data-part="group"] > *:first-child{
margin-left:0;
border-radius:var(--vibeui-inputgroup-006-radius) 0 0 var(--vibeui-inputgroup-006-radius);
}
[data-vibeui-block="inputgroup-006"] [data-part="group"] > *:last-child{
border-radius:0 var(--vibeui-inputgroup-006-radius) var(--vibeui-inputgroup-006-radius) 0;
}
[data-vibeui-block="inputgroup-006"] [data-part="group"] > *:focus{
z-index:1;outline:2px solid var(--vibeui-inputgroup-006-accent);outline-offset:-1px;
border-color:var(--vibeui-inputgroup-006-accent);
}
[data-vibeui-block="inputgroup-006"] [data-part="cell"]{
flex:1;min-width:0;display:flex;align-items:center;gap:0.375rem;padding:0 0.75rem;
}
[data-vibeui-block="inputgroup-006"] [data-part="cell"] span{
flex:none;font-size:0.75rem;color:var(--vibeui-inputgroup-006-muted);
}
[data-vibeui-block="inputgroup-006"] [data-part="cell"] input{
flex:1;min-width:0;height:100%;border:0;background:none;color:inherit;
font:inherit;font-size:0.9375rem;font-weight:600;font-variant-numeric:tabular-nums;
}
[data-vibeui-block="inputgroup-006"] [data-part="cell"] input:focus{outline:none}
[data-vibeui-block="inputgroup-006"] [data-part="cell"] input::-webkit-outer-spin-button,
[data-vibeui-block="inputgroup-006"] [data-part="cell"] input::-webkit-inner-spin-button{appearance:none;margin:0}
/* Тире — сама граница между половинами: ширина в ровно один символ. */
[data-vibeui-block="inputgroup-006"] [data-part="dash"]{
flex:none;display:grid;place-items:center;width:1.75rem;
color:var(--vibeui-inputgroup-006-muted);font-size:0.875rem;
}
[data-vibeui-block="inputgroup-006"] [data-part="hint"]{
margin:0;font-size:0.75rem;line-height:1.4;color:var(--vibeui-inputgroup-006-muted);
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="inputgroup-006"] *{animation:none!important;transition:none!important}}
`
/**
* Диапазон двумя полями в одной сцепке: «от» и «до» с тире между ними.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Inputgroup006({
name = "price",
legend = "Цена, ₽",
unit = "₽",
from = 1500,
to = 9000,
hint = "Пустая половина означает «без ограничения» — так фильтр не заставляет придумывать границу.",
accent,
className,
style,
...props
}: Inputgroup006Props) {
const palette = {
...(accent ? { "--vibeui-inputgroup-006-accent": accent } : null),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-inputgroup-006" precedence="medium">
{STYLES}
</style>
<fieldset
{...props}
data-vibeui-block="inputgroup-006"
className={className}
style={palette}
>
<legend>{legend}</legend>
<div data-part="group">
<div data-part="cell">
<span id={`${name}-from-label`}>от</span>
<input
name={`${name}-from`}
type="number"
inputMode="numeric"
min={0}
defaultValue={from}
placeholder="0"
aria-labelledby={`${name}-from-label`}
aria-describedby={`${name}-hint`}
/>
<span aria-hidden="true">{unit}</span>
</div>
<div data-part="dash" aria-hidden="true">
—
</div>
<div data-part="cell">
<span id={`${name}-to-label`}>до</span>
<input
name={`${name}-to`}
type="number"
inputMode="numeric"
min={0}
defaultValue={to}
placeholder="∞"
aria-labelledby={`${name}-to-label`}
aria-describedby={`${name}-hint`}
/>
<span aria-hidden="true">{unit}</span>
</div>
</div>
<p data-part="hint" id={`${name}-hint`}>
{hint}
</p>
</fieldset>
</>
)
}