explaingit

mizumi25/nagare

Analysis updated 2026-05-18

1TypeScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

A React library that keeps all the CSS, animation, logic, and state for each UI interaction (hover, click, scroll) in one place instead of scattered across multiple files and tools.

Mindmap

mindmap
  root((Nagare))
    Core concepts
      Soul element
      Behavior detector
      Lifecycle stages
      CSS and JS blocks
    Behaviors
      Click and hover
      Scroll and drag
      Idle detection
      Network change
    Reuse
      Templates
      Presets
    Integrations
      React useSoul hook
      Vanilla JS core
      TypeScript plugin
    Use cases
      Collocated behavior
      State-driven CSS
      Animation delegation
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Define a button's hover lift and state change together in one code block without separate CSS files or a state store.

USE CASE 2

Build an idle-state detector that changes the UI after a few seconds of no user activity.

USE CASE 3

Add swipe detection to a card component with direction-aware logic, all in one behavior definition.

USE CASE 4

Share a reusable bounce-on-click animation across multiple elements using Nagare presets.

What is it built with?

TypeScriptReactNode.jsTailwind CSS

How does it compare?

mizumi25/nagareabidoo22/pixelorama-mcpaditya-pandey/slate
Stars111
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderateeasy
Complexity2/53/52/5
Audiencedevelopervibe codergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

In plain English

Nagare is a JavaScript library for React that gives interactive behaviors their own place in your code. In a typical frontend project, a single button hover triggers a cascade: the lift effect is in CSS, the glow is in an animation library, the state update is in a store, and the logic is in an event handler. Nagare argues that a hover is one thing and should live in one place. The library works around two main ideas: a soul (which represents a DOM element) and a behavior (which is a detector that watches for something happening, like a click, hover, scroll, or the network dropping). When a behavior fires, it runs through a lifecycle with three stages: start, update, and end. Inside each stage, you write CSS (plain CSS, not camelCase objects), Tailwind classes, or JavaScript, all together in the same block. To use it in React, you call the useSoul hook and define your souls and their behaviors inside it. The hook handles registering your definitions, binding them to elements, watching for new elements that appear later, and cleaning up when the component unmounts. In your JSX, you mark elements with a data-soul attribute to connect them to their definitions. The JSX itself stays free of class name logic, inline styles, and event handlers. Nagare ships over twenty built-in behaviors including tap, press, swipe with direction info, drag with live position, scroll, resize, focus, visibility detection, idle detection, and network change detection. You can define reusable style snippets called templates and reusable lifecycle definitions called presets to share across multiple souls. State is per-soul and you can reference it directly in CSS blocks using conditional logic. The library also provides a TypeScript plugin for editors like VS Code that adds autocomplete inside Tailwind and CSS string values, including keyword completions. Nagare handles attaching and reacting to behaviors, it does not do animation interpolation or tweening, which you delegate to libraries like GSAP.

Copy-paste prompts

Prompt 1
I'm using Nagare with React. Set up a soul for my card element that scales up on hover and toggles an open/closed state on click, using the css and js blocks.
Prompt 2
Use Nagare's preset system to create a reusable bouncy click animation, then apply it to three different button souls in my project.
Prompt 3
Write a Nagare soul that detects when the user goes idle for 5 seconds and fades out a tooltip element.
Prompt 4
I have a drag behavior in Nagare. Show me how to read this.params inside the js block to log the live x/y position as the user drags.
Prompt 5
Set up the @nagarejs/ts-plugin in my tsconfig.json so I get Tailwind autocomplete inside my Nagare tw strings.

Frequently asked questions

What is nagare?

A React library that keeps all the CSS, animation, logic, and state for each UI interaction (hover, click, scroll) in one place instead of scattered across multiple files and tools.

What language is nagare written in?

Mainly TypeScript. The stack also includes TypeScript, React, Node.js.

How hard is nagare to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is nagare for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub mizumi25 on gitmyhub

Verify against the repo before relying on details.