For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
/
144
Sponsor

Input

A text input with focus ring, border, caret, and value reveal.

you@example.com
Customize

Installation

$ pnpm dlx shadcn@latest add @framecn/input

Usage

import { Input } from "@/components/ui/input";
<Input
  placeholder="you@example.com"
  value="remotion@remocn.dev"
  state="typing"
/>

Smooth transitions

The docs preview animates hover → active → typing → invalid via useInputTransition. Forward primary into the hook when using style so the focus ring tracks the color prop:

import { Input } from "@/components/framecn/input";
import { useInputTransition } from "@/components/framecn/use-input-transition";
 
const style = useInputTransition(
  [
    { at: 10, state: "hover", duration: 8 },
    { at: 24, state: "active", duration: 10 },
    { at: 40, state: "typing", duration: 22 },
    { at: 78, state: "invalid", duration: 12 },
  ],
  { primary: "#171717" }
);
 
<Input
  placeholder="you@example.com"
  value="remotion@remocn.dev"
  style={style}
/>;

style takes precedence over state when both are provided.

API Reference

Input

PropTypeDefault
state"idle" | "hover" | "active" | "typing" | "blur" | "invalid""idle"
styleInputStyle- (takes precedence over state)
placeholderstring"you@example.com"
valuestring"remotion@remocn.dev"
size"sm" | "default" | "lg""default"
primarystring-
fullWidthboolean-
themePartial<FramecnTheme>-
classNamestring-