npm install @solid-primitives/devices
yarn add @solid-primitives/devices
pnpm add @solid-primitives/devices


Creates a primitive to get a list of media devices (microphones, speakers, cameras). There are filtered primitives for convenience reasons.

#How to use it

#Media Devices

const devices = createDevices();

const microphones = createMicrophones();
const speakers = createSpeakers();
const cameras = createCameras();

The filtered primitives are build so that they only triggered if the devices of their own kind changed.

#Device Motion

const accelerometer = createAccelerometer();
const gyroscope = createGyroscope();


Live Site

You may view a working example here:


createAccelerometer : devicemotion event createGyroscope : deviceorientation event