Shimmer Input
An input component with a shimmer effect.
Default
Default shimmer input
examples.tsx
1import { ShimmerInput } from "@/registry/ui/shimmer-input";23export function ShimmerInputExamples() {4 return (5 <div className="flex flex-col gap-4 min-h-64 items-center justify-center">6 <ShimmerInput7 placeholder="How can I help you today?"8 activePlaceholder="Ask me things like: How do I create a new project?"9 minWidth={240}10 maxWidth={390}11 placeholderSpacing={48}12 aria-label="How can I help you today?"13 />14 <ShimmerInput15 placeholder="How can I help you today?"16 activePlaceholder="Ask me things like: How do I create a new project?"17 minWidth={600}18 maxWidth={800}19 placeholderSpacing={48}20 aria-label="How can I help you today?"21 />22 </div>23 );24}
Installation & source
Install via the shadcn CLI or copy the registry files manually.
bash
npx shadcn@latest add @tt-ui/shimmer-input
Props
| Name | Type | Default | Description |
|---|---|---|---|
| activePlaceholder | string | undefined | The active placeholder of the input |
| placeholder | string | undefined | The placeholder of the input |
| collapsedWidth | number | undefined | The collapsed width of the input |
| expandedWidth | number | undefined | The expanded width of the input |
| containerClassName | string | undefined | The class name of the container |
| className | string | undefined | The class name of the input |
| disabled | boolean | false | Whether the input is disabled |
| value | string | undefined | The value of the input |
| defaultValue | string | undefined | The default value of the input |
| onChange | (value: string) => void | undefined | The callback function when the value changes |
| onFocus | (event: React.FocusEvent<HTMLInputElement>) => void | undefined | The callback function when the input is focused |
| onBlur | (event: React.FocusEvent<HTMLInputElement>) => void | undefined | The callback function when the input is blurred |
| type | string | text | The type of the input |
| aria-label | string | undefined | The aria label of the input |