Display

Selectable Row

A selectable row on a native checkbox: state lives in markup, the checkmark is drawn with :has(:checked), and the component stays server-side and form-ready.

  • item
  • row
  • checkbox
  • selection

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-007?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 "item-007" (Selectable Row) 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-007.json

Registry item: https://vibeui.ru/r/item-007.json
Installs to: components/vibeui/item-007.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 selectable row on a native checkbox: state lives in markup, the checkmark is drawn with :has(:checked), and the component stays server-side and form-ready.

A selectable row with a checkmark: a native checkbox, state in markup, submits with the form. Zero dependencies, one file.

## 3. How to use it
import { Item007 } from "@/components/vibeui/item-007"

<Item007 title="Custom domain" name="domain" defaultChecked />

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-007-* palette — do not swap it for your theme tokens
- the native input instead of React state: this keeps the row form-ready and server-rendered
- the transparent stretched input — display:none would drop it out of the focus order
- the focus ring on the row via :has(input:focus-visible)
- changing background, border and box together: a single colour fails for colour blindness
- the label root: clicking anywhere on the row must toggle the choice

## 6. You may change
- title and meta — the title and the description
- name — the form field name, defaultChecked — the initial state
- the accent through the accent prop
- the row width

## 7. Rules
- The state is uncontrolled: to read the choice in React add checked and onChange and make the component client-side.
- For mutually exclusive options switch the type to radio and give the rows a shared name.
- The :has() selector needs a modern browser: older ones lose the selected highlight but keep the choice working.
- 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-007.json
https://vibeui.ru/r/item-007.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-item-007-*. Серверный: React-состояния нет, значение держит нативный input type=checkbox и отдаёт его при отправке формы. Input не скрыт display:none, а растянут прозрачным по строке — иначе он выпал бы из последовательности фокуса. Выбранная строка меняет фон, рамку и заливку квадратика одновременно, потому что одного цвета мало при дальтонизме.

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 Item007Props = Omit<
  ComponentPropsWithoutRef<"label">,
  "children" | "title"
> & {
  title?: string
  meta?: string
  name?: string
  defaultChecked?: boolean
  accent?: string
}

// Идея компонента: строка выбора, где состояние держит нативный чекбокс, а не
// React-состояние. Поэтому компонент серверный, работает в обычной форме и
// отдаёт значение при отправке. Галочка нарисована CSS через :has(:checked),
// сам input не спрятан display:none — он прозрачен и растянут на строку, иначе
// пропадёт из последовательности фокуса. Выбранная строка меняет не только
// цвет, но и заливку с рамкой: одного оттенка мало при дальтонизме.
const STYLES = `
:where([data-vibeui-block="item-007"]){
--vibeui-item-007-bg:oklch(1 0 0);
--vibeui-item-007-fg:oklch(0.23 0.014 265);
--vibeui-item-007-muted:oklch(0.56 0.014 265);
--vibeui-item-007-border:oklch(0.9 0.006 265);
--vibeui-item-007-accent:oklch(0.55 0.19 262);
--vibeui-item-007-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="item-007"]{
position:relative;display:flex;align-items:center;gap:0.6875rem;cursor:pointer;
width:100%;max-width:22rem;box-sizing:border-box;padding:0.625rem 0.75rem;
background:var(--vibeui-item-007-bg);
border:1px solid var(--vibeui-item-007-border);border-radius:0.75rem;
font-family:var(--vibeui-item-007-font);color:var(--vibeui-item-007-fg);
transition:background-color .15s ease,border-color .15s ease;
}
[data-vibeui-block="item-007"] *{box-sizing:border-box}
/* Input прозрачен и растянут, но остаётся в потоке фокуса: display:none убил бы клавиатуру. */
[data-vibeui-block="item-007"] input{
position:absolute;inset:0;margin:0;opacity:0;cursor:pointer;
}
[data-vibeui-block="item-007"]:has(input:focus-visible){outline:2px solid var(--vibeui-item-007-accent);outline-offset:2px}
[data-vibeui-block="item-007"]:has(input:checked){
background:color-mix(in oklab,var(--vibeui-item-007-accent) 7%,var(--vibeui-item-007-bg));
border-color:color-mix(in oklab,var(--vibeui-item-007-accent) 45%,var(--vibeui-item-007-border));
}
[data-vibeui-block="item-007"] [data-part="box"]{
flex:none;display:grid;place-items:center;
width:1.125rem;height:1.125rem;border-radius:0.375rem;
border:1.5px solid var(--vibeui-item-007-border);
color:transparent;font-size:0.6875rem;font-weight:800;line-height:1;
transition:background-color .15s ease,border-color .15s ease,color .15s ease;
}
[data-vibeui-block="item-007"]:has(input:checked) [data-part="box"]{
background:var(--vibeui-item-007-accent);border-color:var(--vibeui-item-007-accent);
color:oklch(1 0 0);
}
[data-vibeui-block="item-007"] [data-part="text"]{display:grid;gap:0.125rem;min-width:0}
[data-vibeui-block="item-007"] [data-part="title"]{font-size:0.875rem;font-weight:650;line-height:1.3}
[data-vibeui-block="item-007"] [data-part="meta"]{font-size:0.75rem;line-height:1.35;color:var(--vibeui-item-007-muted)}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="item-007"] *{animation:none!important;transition:none!important}}
`

/**
 * Строка выбора с галочкой на нативном чекбоксе, без клиентского состояния.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Item007({
  title = "Отдельный домен",
  meta = "Подключается за пять минут · 490 ₽ в месяц",
  name = "option",
  defaultChecked = true,
  accent,
  className,
  style,
  ...props
}: Item007Props) {
  const palette = {
    ...(accent ? { "--vibeui-item-007-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-item-007" precedence="medium">
        {STYLES}
      </style>
      <label
        {...props}
        data-vibeui-block="item-007"
        className={className}
        style={palette}
      >
        <input type="checkbox" name={name} defaultChecked={defaultChecked} />
        <span data-part="box" aria-hidden="true">
          ✓
        </span>
        <span data-part="text">
          <span data-part="title">{title}</span>
          {meta ? <span data-part="meta">{meta}</span> : null}
        </span>
      </label>
    </>
  )
}