a ? "active" : "inactive"), 42]} />
```
The key concept is the **reset**: every evaluation of the `class` prop starts by clearing the element's current classes, then applies the new value. What "applying" means depends on the shape of the value:
- **String or number** — after the reset, the class list is set to that single value. Everything the element had before is gone.
```tsx
// element's classes become exactly "abc"
```
- **Array** — after the reset, each entry is **added** to the class list. Entries are applied together, side by side; no entry replaces another. Entries may be strings, numbers, or signals (each signal entry is bound individually and adds/removes its own class on change).
```tsx
// element's classes become "base-class abc" (and "foo" comes and goes with the signal)
a && "foo"), "abc"]} />
```
- **Record** (`{ [className]: boolean | Signal
}`) — after the reset, each key is added or removed based on the truthiness of its condition; conditions may be signals.
```tsx
// element's classes become "highlighted", tracking `active` on every change
```
- **Signal** — the signal's value is evaluated with the rules above on every change (so a signal of an array re-resets and re-applies the whole array on each change).
Two things worth calling out:
- Replacement only ever happens at the **top level**. Inside an array, everything is additive — `["abc", someSignal]` never discards `"abc"` when the signal changes, because the reset happens once per evaluation of the whole prop value, before any entry is applied.
- Mixing shapes is only possible inside a **signal**: since a signal's value is re-evaluated wholesale, a signal that emits an array (or a record) treats each emission as a fresh top-level value. A plain array's entries, however, must each be a string, number, or signal — a record is not supported as an array entry and will log a warning.
```tsx
const classes = sig(["foo", "bar"]);
// ✅ each emission is a fresh top-level value: reset, then add "foo" and "bar"
// ⚠ records can't be entries of a plain array
// logs "unsupported object used as class name"
```
## Style
The `style` prop accepts a string or an object. In the object form each key can be a signal, and numeric values get `"px"` appended (custom properties starting with `--` go through `setProperty` instead):
```tsx
const color = sig("red");