Tailwind UI Pattern Registry for humans and agents

neural-network ai machine-learning animated pulses nodes graph

Neural Network

Details

Category
interactive
Complexity
medium
Browser
baseline-2024
Updated
2026-05-17
Animated Reduced Motion aria-hidden
neural-networkaimachine-learninganimatedpulsesnodesgraph

Parameters

Name Type Default Description
LAYERS array [4, 5, 5, 3] Neuron count per layer — [input, hidden1, hidden2, output]
PULSE_SPEED number 0.4 Signal pulse travel speed (fraction of connection length per second)
ACTIVATION_INTERVAL number 1.8 Base seconds between random neuron activations

A four-layer feedforward network rendered entirely on canvas. Neuron positions are computed from the layer configuration so the layout stays balanced at any canvas size. Signal pulses spawn on random outgoing connections whenever a neuron activates, traveling along the connection line with a short trail and a fade-in/out alpha curve. Dark mode detection reads document.documentElement.classList.contains('dark') so the color palette switches automatically. When reducedMotion is true, the network renders as a static diagram with no pulses or activations.