npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

roaming-studios-hooks

v1.0.0

Published

Hooks livianos para UI components usando CSS animations y JavaScript vainilla.

Downloads

21

Readme

🎯 UI Hooks

Hooks livianos para UI components usando CSS animations y JavaScript vainilla.

📦 Estructura

🎨 Animations hooks

Hooks para microanimaciones y transiciones.

📝 Forms hooks

Hooks para manejo de formularios y validación.


🎨 Animation Hooks

useFadeIn

Animación de entrada con desvanecimiento.

import { useFadeIn } from 'roaming-studios-ui/hooks/animations';

const { elementRef, className } = useFadeIn({ 
  trigger: true, 
  duration: 300, 
  direction: 'up' 
});
<Text ref={elementRef} className={className}>Animated text</Text>

useSlideIn

Animación de entrada con deslizamiento.

import { useSlideIn } from 'roaming-studios-ui/hooks/animations';

const { elementRef, className } = useSlideIn({ 
  trigger: true, 
  direction: 'left', 
  distance: 20 
});
<Card ref={elementRef} className={className}>Slide in content</Card>

useAnimateOnScroll

Activa animación cuando el elemento entra en el viewport.

import { useAnimateOnScroll } from 'roaming-studios-ui/hooks/animations';

const { elementRef, isVisible, className } = useAnimateOnScroll({ 
  threshold: 0.2,
  animation: 'fade-in',
  direction: 'up'
});
<Text ref={elementRef} className={className}>Animates when visible</Text>

useHover

Microinteracciones en hover.

import { useHover } from 'roaming-studios-ui/hooks/animations';

const { elementRef, isHovered, style } = useHover({ 
  scale: 1.05, 
  lift: 4 
});
<Card ref={elementRef} style={style}>Hover me</Card>

📝 Form Hooks

useFormField

Manejo de estado y validación para campos de formulario.

import { useFormField } from 'roaming-studios-ui/hooks/forms';

const { value, error, handleChange, handleBlur } = useFormField({
  initialValue: '',
  validate: (value) => value.length < 3 ? 'Too short' : undefined
});

<Input
  value={value}
  onChange={(e) => handleChange(e.target.value)}
  onBlur={handleBlur}
  error={error}
/>

🎨 CSS requerido

Agregar estas animaciones al CSS global:

/* Fade in animations */
.animate-fade-in-wrapper {
  --fade-duration: 300ms;
  --fade-delay: 0ms;
}

.animate-fade-in {
  animation: fadeIn var(--fade-duration) ease-out var(--fade-delay) forwards;
}

@keyframes fadeIn {
  from { 
    opacity: 0;
    transform: translateY(10px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide in animations */
.animate-slide-in-wrapper {
  --slide-duration: 400ms;
  --slide-delay: 0ms;
  --slide-distance: 30px;
}

.animate-slide-in {
  animation: slideIn var(--slide-duration) ease-out var(--slide-delay) forwards;
}

@keyframes slideIn {
  from { 
    opacity: 0;
    transform: translateX(var(--slide-distance));
  }
  to { 
    opacity: 1;
    transform: translateX(0);
  }
}

/* Direction variants */
.animate-fade-in-down { transform: translateY(-10px); }
.animate-fade-in-up { transform: translateY(10px); }
.animate-fade-in-left { transform: translateX(10px); }
.animate-fade-in-right { transform: translateX(-10px); }

.animate-slide-in-left { transform: translateX(var(--slide-distance)); }
.animate-slide-in-right { transform: translateX(calc(var(--slide-distance) * -1)); }
.animate-slide-in-up { transform: translateY(var(--slide-distance)); }
.animate-slide-in-down { transform: translateY(calc(var(--slide-distance) * -1)); }

🚀 Características

  • Ultra liviano - < 1KB JavaScript total
  • CSS animations - Hardware acceleration
  • Performance - IntersectionObserver para scroll
  • Componible - Usar solo lo que necesitas
  • TypeScript - Full type safety
  • Flexible - Props configurables

📋 Uso en componentes

import { useFadeIn, useAnimateOnScroll } from 'roaming-studios-ui/hooks';

const MyComponent = () => {
  const { elementRef, className } = useFadeIn({ duration: 500 });
  
  return (
    <Text ref={elementRef} className={className}>
      Animated content
    </Text>
  );
};

🎯 Principios

  • Simple sobre complejo - CSS animations > librerías pesadas
  • Opt-in - Solo se carga si se usa
  • Performance first - GPU acceleration cuando es posible
  • Agnóstico - Funciona con cualquier componente