## Smart Lock (S—289)

A smart lock card: tap the big shackle to lock or unlock with a short working state, auto-lock timer, and access log.

- URL: https://sundaeui.dev/components/lock-control
- Category: UI components · Art direction: Refined
- Access: Free (no account needed)
- Stack: React 18+, TypeScript, plain CSS; dependencies: none
- Install: `npx shadcn@latest add https://sundaeui.dev/r/lock-control.json`
- Tags: security, iot, smart-lock, door, access, home

The lock icon animates its shackle between states; while the bolt moves the button shows Working and ignores taps. Unlocking starts an auto-lock countdown.
Recent activity lists who used the door and how, newest first, including your own taps.

### Usage

```tsx
import { LockControl } from '@/components/sundae/lock-control'

<LockControl />
```

### Props

- `locked` (`boolean`, default `true`): Initial state.
- `autoLock` (`number`, default `30`): Seconds before re-locking; 0 to disable.
- `log` (`{ who: string; what: string; when: string }[]`): Recent activity.
- `fill` (`'dark' | 'light'`, default `'dark'`): Surface: dark or light.

### When to use

- Smart-home apps, building access.

### When not to use

- Multi-door access control: use a table of doors.

### Accessibility

- The main control is a button with aria-pressed for locked and a text state.
- State changes and auto-lock are announced.
- Reduced motion removes the movement and keeps every state change.
