Group-glass input

input-group-glass is a set of five frosted-glass input fields (FrostGroup, TintGroup, SmokeGroup, CrystalGroup, DepthGroup) that each pair a decorative lucide icon with a real input inside a translucent glass surface. Each variant takes its glass technique from the ai2 glassDepth scale, and sizes run from sm to xl.

componentstyledinputregistry-item.json
Group-glass input
LIVE · running in a sandboxed iframe
Installed with shadcn add · 2 workarounds · theme from registry.json
  • applied the registry's theme (tokens, fonts and CSS from the registry preview settings)
  • installed base item https://ai2.design/r/tokens.json (registry preview settings)
See how it was built

Installation

pnpm dlx shadcn@latest add @ai2/input-group-glass

Requires @ai2 in the registries of your components.json (shadcn adds official directory namespaces automatically).

Usage

usage.tsx
import { FrostGroup, TintGroup, SmokeGroup, CrystalGroup, DepthGroup } from "@/components/ui/input-group-glass"export function Demo() {  return (    <div className="flex flex-col gap-3">      <FrostGroup placeholder="Search" />      <TintGroup placeholder="Ask AI" />      <SmokeGroup placeholder="Password" type="password" />      <CrystalGroup placeholder="Username" />      <DepthGroup placeholder="Email" type="email" />    </div>  )}
  • Use a glass-style text field on top of imagery, gradients or layered hero and dashboard surfaces where a frosted look adds depth.
  • Pick the variant by character: FrostGroup for neutral, TintGroup for informational or highlighted fields, SmokeGroup for dark overlays, CrystalGroup for a clear field with a bright edge, DepthGroup for a field that appears to lift off the page.
  • Use it for search bars, command fields, email or handle entry and other single-line inputs in the ai2 styled layer.
  • Avoid it for dense forms or places where the text needs maximum contrast against a busy background; use a standard input there.

Examples

Sizes

All variants accept the size prop (sm, md, lg, xl). The default is md.

sizes.tsx
import { FrostGroup } from "@/components/ui/input-group-glass"export function Sizes() {  return (    <div className="flex flex-col items-start gap-3">      <FrostGroup size="sm" placeholder="Small" />      <FrostGroup size="md" placeholder="Medium" />      <FrostGroup size="lg" placeholder="Large" />      <FrostGroup size="xl" placeholder="Extra large" />    </div>  )}

Tinted search bar with a custom width

className is applied to the outer glass root, so it can change the width or layout of the whole field. Native input props such as name and autoComplete go to the input.

tinted-search-bar-with-a-custom-width.tsx
import { TintGroup } from "@/components/ui/input-group-glass"export function SearchBar() {  return (    <TintGroup      size="lg"      name="q"      autoComplete="off"      placeholder="Search the docs"      className="w-96"    />  )}

Disabled and invalid state

disabled is forwarded to the input and dims it. aria-invalid triggers the danger styling on the input.

disabled-and-invalid-state.tsx
import { SmokeGroup } from "@/components/ui/input-group-glass"export function States() {  return (    <div className="flex flex-col gap-3">      <SmokeGroup placeholder="Locked" disabled />      <SmokeGroup placeholder="Invalid value" aria-invalid defaultValue="nope" />    </div>  )}

API reference

PropTypeDefaultDescription
size"sm" | "md" | "lg" | "xl""md"Controls the field height and text size: sm is h-8 text-sm, md is h-9 text-sm, lg is h-10 text-base, xl is h-12 text-base. Exported as the StyledSize type.
classNamestring—Merged with the root glass classes via cn() (tailwind-merge). Applies to the outer wrapper div, not the input.
...props (React.ComponentProps<"input"> minus "size")InputHTMLAttributes<HTMLInputElement> without size—All native input attributes such as placeholder, type, name, value, defaultValue, onChange, disabled, required and aria-invalid are forwarded to the inner input element.

Accessibility

  • Every variant renders a visually hidden label (sr-only) tied to the input through htmlFor and a generated useId value, so each field has an accessible name: "Frosted field", "Tinted field", "Smoked field", "Crystal field" or "Depth field". These labels are generic, so set aria-label or aria-labelledby on the input to give a meaningful name, for example through a props spread that replaces the default label association.
  • Passing your own id prop overrides the generated id on the input (the spread comes after id), which breaks the label association; avoid passing id, or wire up labelling explicitly.
  • The leading and trailing icons are decorative and rendered without aria-hidden; they are muted or primary-coloured for visual cues only, so do not rely on them to convey state.
  • Focus is shown with an outline (3px, ring/50) and a primary border on focus-within, rather than ring, so the focus indicator stays visible on the glass surface.
  • Invalid state uses aria-invalid on the input; pass aria-invalid so the danger styling and assistive technology both get the signal.
  • Disabled fields dim the input with opacity-50 and disable the cursor; keep text contrast in mind when placing the glass over busy imagery, since the translucent fill can reduce legibility.

Docs written by anthropic:claude-haiku-5-5 from the registry source.

Use with Coding Agent

Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.

prompt.md
Use the "Group-glass input" component (ai2/input-group-glass) from its shadcn registry.1. Install it with: npx shadcn@latest add @ai2/input-group-glass2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: size, className, ...props (React.ComponentProps<"input"> minus "size").Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { FrostGroup, TintGroup, SmokeGroup, CrystalGroup, DepthGroup } from "@/components/ui/input-group-glass"export function Demo() {  return (    <div className="flex flex-col gap-3">      <FrostGroup placeholder="Search" />      <TintGroup placeholder="Ask AI" />      <SmokeGroup placeholder="Password" type="password" />      <CrystalGroup placeholder="Username" />      <DepthGroup placeholder="Email" type="email" />    </div>  )}```

Files & dependencies

  • registry/ai2/styled/input-group-glass.tsx→ components/ui/input-group-glass.tsx
dependencieslucide-react@^1.23.0
registryDependencies@ai2/tokens@ai2/glass

Looks similar, elsewhere