Skip to main content
Version: 1.0.3

Exploding Input

The ExplodingInput component is a delightful, interactive input field that renders performant canvas-based particle explosions as the user types.

Typed Characters (Letters)
Cursor Trail

Installation

ignix add component exploding-input

Usage

import { ExplodingInput } from '@ignix-ui/exploding-input';

Basic Usage

export default function App() {
return (
<ExplodingInput
placeholder="Type to celebrate..."
triggerMode="keypress"
particlePreset="confetti"
/>
);
}

Props

PropTypeDefaultDescription
triggerMode"keypress" | "submit" | "focus" | "clear" | "custom""keypress"Modes that trigger the explosion
particlePreset"confetti" | "sparks" | "stars" | "bubbles" | "letters" | "emoji""confetti"Type of spawned particles
customEmojistring[]DEFAULT_EMOJIArray of emoji characters
characterParticlesbooleanfalseIf true, the typed character itself becomes the explosion particle
direction"up" | "down" | "left" | "right" | "radial" | "burst""up"Direction of the particle spread
cursorTrailbooleanfalseTrailing spark effect continuously while focused
validate(value: string) => booleanundefinedChanges particle color to green/red based on validity
maxParticlesnumber400Max canvas particles alive at once
audio"pop" | "whoosh" | "sparkle" | stringundefinedTriggers a sound effect hook
explodeRefReact.Ref<ExplodingInputHandle>undefinedRef used to manually trigger the explode() instance method