Reference
Manual / 01
Everything you need to build intelligent collective systems. From basic physics configuration to advanced vector field evolution.
Installation
Integrate BoidsJS into your project via npm or yarn. Zero dependencies, lightweight at < 5kb.
npm install @individual11/boidsjs
# or
yarn add @individual11/boidsjsQuick Start
The easiest way to get started is with our dedicated React wrapper. Simply drop the component into your workspace.
import { BoidsJS } from '@individual11/boidsjs/react';
const App = () => (
<div style={{ width: '100vw', height: '100vh' }}>
<BoidsJS boidCount={200} algorithm="optimized" />
</div>
);/ API Reference
Core Configuration
Total number of boids in the simulation.
Color of the boids.
Visual shape: 'triangle', 'circle', or 'line'.
Size of the boids in pixels.
Physics & Behavior
The flocking logic: 'reynolds', 'optimized', or 'flow-field'.
Maximum velocity magnitude.
Minimum velocity magnitude.
Stability and steering strength.
Interactions
Mode: 'none', 'attract', or 'repulse'.
Influence radius for mouse interaction.
Number of specialized predators to avoid.
Visual Aids
Visualize underlying flow lines.
Visualize underlying noise map.
Color of the flow lines.
Reynolds Options
Neighbor detection radius.
Strength of velocity matching.
Strength of group centering.
Strength of collision avoidance.
Flow Field Options
Density of the noise field.
Steering impact of the field.
Hooks & Callbacks
Callback executed on every animation frame.