useParticleSystem
import { useParticleSystem } from "@pibbl/core/particles";Creates a stable component-owned system for an immutable 2D definition.
Its controls are play, pause, resume, restart, emit, and stop.
status and execution are readonly Pibbl signals.
Commands enter the shared scheduler’s Begin phase. Population advances in Advance, metadata publishes in Commit, renderer work plans and paints, and events/errors deliver in Complete. Removal cancels queued commands, unregisters the scheduler participant, releases the renderer binding and parameter epochs, and makes retained controls inert.
Use explicit system mode when event handlers need manual bursts or lifecycle controls. Canvas supports both automatic emission and manual births.
Types: PibblParticleSystem,
PibblParticleSystemOptions,
PibblParticleSystemStatus, and
PibblParticleExecution.
API details from source
Section titled “API details from source”
Creates a mount-owned system retaining the effect’s emitter and parameter types. See PibblParticleEffect2D, PibblParticleSystemOptions, and PibblParticleSystem. Creates one stable particle-system handle owned by the current hook slot.
useParticleSystem: <EmitterName extends string, Parameters extends PibblParticleParameterValues>(effect: SignalValue<PibblParticleEffect2D<EmitterName, Parameters>>, options?: SignalValue<SignalFields<PibblParticleSystemOptions>>) => PibblParticleSystem<EmitterName, Parameters>Related API: useParticleSystem, PibblParticleParameterValues, SignalValue, PibblParticleEffect2D, PibblParticleSystemOptions, PibblParticleSystem.
Parameters
Section titled “Parameters”-
effect— Effect definition, optionally supplied by a signal. See SignalValue , PibblParticleEffect2D . -
options— Playback and simulation options, optionally supplied by a signal. See SignalValue ,SignalFields, PibblParticleSystemOptions . -
effectInput— Effect definition, optionally supplied by a signal. See SignalValue , PibblParticleEffect2D . -
optionsInput— Playback and simulation options, optionally supplied by a signal. See SignalValue ,SignalFields, PibblParticleSystemOptions .
Returns
Section titled “Returns”Stable mount-owned controls for the particle simulation. See PibblParticleSystem.
See also
Section titled “See also”View source — packages/core/src/features/particles/lib/system/hook.ts:39
Implementation guidance for agents
Section titled “Implementation guidance for agents”Read the Canvas particles companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.
Complete minimal examples
Section titled “Complete minimal examples”- Mounted particle system: Mount a manual burst effect and trigger it with pointer input. Plain source
Interactive examples
Section titled “Interactive examples”Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision 2dccb19. ALPHA — NOT FOR PRODUCTION USE.