Aurora Input
aurora-dinglebear-ai/aurora-inputUnverifiedComponent
Text input with Aurora focus glow, leading/trailing adornment slots, and control-surface background.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/dinglebear-ai/aurora/main/aurora-input.jsonSource
1"use client"23import * as React from "react"4import { X } from "lucide-react"5import { cn } from "@/lib/utils"67function devWarn(message: string): void {8 if (process.env.NODE_ENV !== "production") {9 console.warn(message)10 }11}1213export type InputState = "error" | "warn" | "success"14export type InputSize = "sm" | "default" | "lg"1516export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {17 /** Optional leading icon or adornment */18 startAdornment?: React.ReactNode19 /** Optional trailing icon or adornment */20 endAdornment?: React.ReactNode21 /**22 * Validation state. Sets border color and glow ring using Aurora status tokens.23 * - error: --aurora-error border + ring24 * - warn: --aurora-warn border + ring25 * - success: --aurora-success border + ring26 */27 state?: InputState28 /**29 * Convenience alias for state="error". When both are set, `state` takes precedence.30 */31 error?: boolean32 /**33 * Input size variant.34 * - sm: h-7, caption font, px-2.535 * - default: h-9 (original), body-sm font, px-336 * - lg: h-10, control font, px-3.537 * @default "default"38 */39 size?: InputSize40 /**41 * When true and the input has a value, shows a clear (×) button as the end adornment.42 * The clear button calls `onClear` if provided, otherwise fires `onChange` with an43 * empty synthetic-like event.44 */45 clearable?: boolean46 /** Callback fired when the clear button is clicked. Escape hatch for controlled inputs. */47 onClear?: () => void48 /**49 * Escape hatch. When true, renders a BARE `<input>` with no wrapper, no inline50 * style skin, no imperative focus handlers, and no adornment/clear logic — only51 * `className`, the forwarded `ref`, `type`, and the remaining props are applied,52 * so the consumer's className/CSS owns 100% of the appearance. The styled path53 * (default) is unaffected.54 * @default false55 */56 unstyled?: boolean57}5859/** Token map for validation states */60const STATE_TOKENS = {61 error: {62 border: "var(--aurora-error)",63 ring: "var(--aurora-error)",64 },65 warn: {66 border: "var(--aurora-warn)",67 ring: "var(--aurora-warn)",68 },69 success: {70 border: "var(--aurora-success)",71 ring: "var(--aurora-success)",72 },73} as const7475/** Resting box-shadow for a state — subtle 1px ring */76function stateRestShadow(color: string): string {77 return `0 0 0 1px color-mix(in srgb, ${color} 30%, transparent)`78}7980// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from aurora
All 176 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Aurora Accordionaurora-accordion | aurora | Components | Unverified | 2 deps | |
| Aurora Alert Dialogaurora-alert-dialog | aurora | Components | Unverified | 2 deps | |
| Aurora Aspect Ratioaurora-aspect-ratio | aurora | Components | Unverified | no deps | |
| Aurora Avataraurora-avatar | aurora | Components | Unverified | 1 dep | |
| Aurora Badgeaurora-badge | aurora | Components | Unverified | 2 deps | |
| Aurora Banneraurora-banner | aurora | Components | Unverified | 1 dep | |
| Aurora Breadcrumbaurora-breadcrumb | aurora | Components | Unverified | 2 deps | |
| Aurora Buttonaurora-button | aurora | Components | Unverified | 2 deps |
