Components

Ice Input

A frosted-glass text input for React, built on the DuskUI Input with Motion and Tailwind CSS. On focus, frost spreads across the field from where you clicked and the border takes a cool tint, while it stays a native input that works with labels, autofill and forms.

  • Built on Input
  • Frost-spread focus
  • Any frost color
  • Invalid state
  • prefers-reduced-motion

Installation

$ npx shadcn@latest add https://duskui.com/r/ice-input.json

Builds on the DuskUI Input; the CLI installs it automatically. Installing by hand? Add components/ui/input.tsx from the Input page first.

Usage

newsletter.tsx
import { Mail } from "lucide-react"
import { IceInput } from "@/components/dusk/glass/ice-input"

export function Newsletter() {
  return <IceInput type="email" icon={<Mail />} placeholder="you@example.com" aria-label="Email" />
}

Examples

Colors

color takes any CSS color — a hex, oklch() or a theme variable like var(--color-primary). The frost, border and focus ring are all mixed from it.

Invalid

Set aria-invalid and the tint switches to the destructive color. Link the message with aria-describedby.

Enter a full email address, like ava@dusk.dev.

API Reference

Also accepts every native <input> prop, which is passed to the underlying Input. className styles the input; wrapperClassName styles the glass.

PropTypeDefaultDescription
colorstring"oklch(0.86 0.11 215)"Frost and focus color — any CSS color. Switches to destructive when aria-invalid.
iconReactNode—Decorative leading icon. Label the input itself.
wrapperClassNamestring—Classes for the glass wrapper (width, radius…).

Accessibility

  • It's a native <input>: pair it with a <label htmlFor> or aria-label; autofill and password managers keep working.
  • Focus is always visible: the border tints and a focus ring appears, and the frost covers the field from the left edge for keyboard focus.
  • Icons and effect layers are aria-hidden. Browsers without backdrop-filter get an opaque field for contrast.
  • With reduced motion the frost appears instantly instead of spreading. The effect is a clip-path, so the field never changes size.