Magoo Component UI logo Magoo Component UI
← Catalog

Lock Status

lock-status molecule experimental

A smart-lock tile showing locked or unlocked state with a colour-coded icon and a toggle button.

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

Front door

Locked Unlocked · 2 min ago

Unlocked

Back gate

Locked Unlocked · just now

Props

NameTypeReq
name string ✓
locked boolean
last_changed string

Related components

How to use

Layout is static and renders with no JavaScript, so the icon, status text and button label reflect the locked prop at render time. behavior.js wires the button: clicking it flips data-locked on every keyed element (icon, status labels, button labels) so the colour and wording swap, and dispatches a bubbling "lock:toggle" event with the new locked state. The portable self-init reads state from the DOM and passes no props.

Use cases

cardcontrol WCAG AA SEO 20 dir: both ai-generated