Keyframery

Animated File Input for UI SDK

A drop zone that wakes up when a file is over it, with new file rows arriving one after another.

Part of Keyframery, the open-source animated components for UI SDK

The demo plays by itself. Point at it or press Tab to take over.

Installation

npx shadcn@latest add @keyframery/file-input

This adds components/keyframery/file-input.tsx and its primitive, components/keyframery/primitives/file-input.tsx, to your project, and installs @ui-sdk/react. The motion tokens are added to your global CSS the first time you install a component.

Usage

import {
  FileInput,
  FileInputDropzone,
  FileInputDropzoneIcon,
  FileInputItem,
  FileInputItemRemove,
  FileInputList,
  FileInputTrigger,
} from "@/components/keyframery/file-input"

The parts and props are the same as UI SDK's File Input. For every prop, see the UI SDK file input reference.

What moves

MoveWhat you see
SpringThe drop zone lifts and its icon rises while a file is over it.
CascadeNew file rows arrive one after another.
PressButtons press in.

Timing and springiness follow the motion style you set, so this component moves like the rest of your app.

Swap the import

Already using UI SDK's file input with your own styles? Keep your markup and change one line. The primitive adds motion and nothing else.

// Before
import { … } from "@ui-sdk/react/file-input"

// After: same parts, same props, now animated
import { … } from "@/components/keyframery/primitives/file-input"

Parts

The finished component exports 7 parts:

FileInput, FileInputDropzone, FileInputDropzoneIcon, FileInputItem, FileInputItemRemove, FileInputList, FileInputTrigger

Accessibility

Keyboard, focus and screen-reader behaviour come from UI SDK and are not changed. With reduced motion turned on, nothing in the file input moves: changes happen at once or with a short fade. More in Accessibility.

Source

The code that lands in your project. It is yours to change.

Questions

How does the animated File Input for UI SDK move?

Spring: The drop zone lifts and its icon rises while a file is over it. Cascade: New file rows arrive one after another. Press: Buttons press in.

Do I need Motion or Framer Motion for the animated File Input?

No. Every move is plain CSS, so there is nothing to install besides the component and UI SDK.

Can I keep my own styling and only take the motion?

Yes. Import from @/components/keyframery/primitives/file-input instead. It has the same parts and props as @ui-sdk/react/file-input and adds motion only.

What happens to the File Input when someone turns on reduced motion?

Nothing moves. State changes happen at once, or with a short fade.

On this page