Magoo Component UI logo Magoo Component UI
← Catalog

Device Group Card

device-group-card molecule experimental

A grouped-device tile with a device icon, an on/total count, and a master on/off switch.

Also in: Cards

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

Default

Downstairs lights

4/6 on

AllOn

Outdoor speakers

3/3 on

Props

NameTypeReq
name string ✓
icon string
device_count integer
on_count integer
all_on boolean

Related components

How to use

Layout is static and renders with no JavaScript, so the badge, count and switch position reflect the props at render time. behavior.js wires the master switch: clicking it flips data-state on the button and knob (and aria-checked) and dispatches a bubbling "group:toggle" event with the new all_on state, which the host can use to command every device in the group. The portable self-init reads state from the DOM and passes no props.

Use cases

cardcontrol WCAG AA SEO 20 dir: both ai-generated