Spell UI
repository·main·Indexed 21 days ago
https://github.com/xxtomm/spell-uiA library of sophisticated, motion-first UI components for modern React applications using Tailwind CSS. Built with Motion to ensure smooth 60fps animations, Spell UI provides pre-built components such as text reveals, shimmer effects, tilt cards, animated backgrounds, and marquees. It utilizes a shadcn-compatible CLI for copy-paste installation, allowing developers to maintain full ownership of the component code.
What's inside spell-ui
- Spell UI provides beautiful, sophisticated UI components specifically designed for modern React applications using Tailwind CSS. It is intended to enhance the visual quality and user experience of React-based web interfaces.
What is Spell UI
mainSpell UI is a curated collection of reusable components, blocks, and templates designed for building landing pages and marketing materials. It is inspired by the design philosophy ofshadcn/ui, focusing on high-quality, polished aesthetics to help build user trust and professional brand presentation.Use Spell UI Pre-Built Text Animation Components
mainSpell UI provides optimized, ready-to-use React components for common text animation patterns. These components handle text splitting, timing, and performance optimizations automatically.
Available components:
BlurReveal: Transitions text from blurred to focused, word by word.WordsStagger: Configurable word-by-word entrance animations.ShimmerText: Gradient shimmer effect with customizable colors and speed.
Compare Tailwind CSS component libraries
mainWhen choosing a Tailwind CSS component library in 2026, consider your project's specific needs regarding ownership, speed, accessibility, and motion:
Need Recommended Library Full code ownership shadcn/ui or Spell UI Rapid prototyping daisyUI or Flowbite Top-tier accessibility Radix UI or Headless UI Animations & Micro-interactions Spell UI Full-scale applications Mantine or NextUI Official Tailwind Labs design Catalyst Core features of Spell UI components
mainSpell UI is a collection of animated UI components designed for React and Tailwind CSS. Key characteristics include:
- Motion-powered animations: Uses Motion for smooth, interactive transitions.
- Copy-paste friendly: Components are designed to be added directly to your codebase without heavy dependency overhead.
- Tailwind CSS integration: Built with Tailwind for easy theming and customization.
- Accessibility & Performance: Follows web accessibility standards and targets 60fps animations.
Orchestrate multiple elements with Variants
mainVariants allow you to define named animation states (e.g.,
"hidden","visible") and orchestrate children automatically.Key Features:
- Staggering: Use
staggerChildrenwithin a parent's transition object to add a delay between each child's animation. You do not need to manually calculate delays for each child. - Propagation: When a parent's variant changes, all children with matching variant names will automatically animate to that state.
Mental Model: Define a
containerVariantsfor the parent anditemVariantsfor the children. The parent controls the timing, while the children define the individual movement.const containerVariants = { hidden: {}, visible: { transition: { staggerChildren: 0.08, }, }, }; const itemVariants = { hidden: { opacity: 0, y: 16 }, visible: { opacity: 1, y: 0, transition: { duration: 0.4 }, }, }; // Usage: <motion.div variants={containerVariants} initial="hidden" animate="visible"> // <motion.div variants={itemVariants} /> // </motion.div>- Staggering: Use
Best practices for animation performance
mainTo avoid frame drops and jank, follow these performance rules:
- Use GPU-composited properties: Only animate
transformandopacityfor CSS animations. - Prefer CSS Transitions: Use transitions over keyframe animations for interactions so they can be interrupted smoothly by user behavior.
- Use
will-changesparingly: Only apply it to elements that are about to animate. - Lazy-load complex effects: For WebGL or heavy particle systems, provide static fallbacks to ensure the page remains functional while assets load.
- Use GPU-composited properties: Only animate
Implement Pause on Hover for Toast Auto-Dismiss
mainTo improve user experience, you can pause the auto-dismiss timer when a user hovers over a toast. This prevents the notification from disappearing while the user is reading it.
Implementation Logic
- Track the
remainingRef(remaining time) andstartTimeRef(when the timer started). - Use
onMouseEnterto set anisPausedstate totrue. - Use
onMouseLeaveto setisPausedtofalse. - When the timer resumes, calculate the remaining time so the toast doesn't restart its full duration.
// Logic for tracking remaining time React.useEffect(() => { if (isPaused || toast.duration === Infinity) return startTimeRef.current = Date.now() timerRef.current = setTimeout(handleDismiss, remainingRef.current) return () => { clearTimeout(timerRef.current) remainingRef.current -= Date.now() - startTimeRef.current } }, [isPaused, handleDismiss, toast.duration])- Track the
Design a Pricing section
mainEffective pricing sections should include:
- 3 Tiers: Typically 'good', 'better', and 'best'.
- Visual Highlight: Call out the recommended plan.
- Feature Lists: 5-7 checkmarked features per tier.
- Billing Toggle: Switch between monthly and annual billing.
- Objection Handling: Include text like "No credit card required" or "Cancel anytime".
How Spell UI fits into a React UI stack
mainSpell UI is an animation-focused component library designed for motion and interactivity. It provides components like tilt cards, animated borders, and spotlight effects.
Unlike traditional component libraries, Spell UI follows a copy-paste, Tailwind-native philosophy similar to shadcn/ui. This means it is designed to integrate cleanly alongside existing UI frameworks (like MUI, Radix, or shadcn/ui) rather than replacing them. It is best used when your project requires high-fidelity motion and sophisticated interactive elements that standard UI libraries often lack.
Implement a custom keyboard listener with Kbd
mainYou can create a dynamic keyboard shortcut display by setting thelistenToKeyboardprop totrue. This allows the component to automatically toggle its visual 'pressed' state when the user presses the specified keys on their physical keyboard.When to avoid lazy loading
mainLazy loading adds network overhead and complexity. Avoid using it for:
- Above-the-fold components: Components visible immediately on page load. Lazy loading these adds unnecessary delay to the initial render.
- Small components: If a component is very small (e.g., under 10KB), the overhead of a new network request may be greater than the benefit of splitting it.
- Critical path components: Elements like navigation, headers, and footers that appear on every page should remain in the main bundle.