[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/flow](../../README) / [index](../README) / presence

# Function: presence()

> **presence**(`channel`): (`value`, `context`) => `void`

Defined in: [flow/src/decorators.ts:502](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/decorators.ts#L502)

Binds a field to a broadcast presence channel — the framework keeps it filled with the live
member list (who's here), updating on join/leave.

## Parameters

### channel

[`PresenceChannel`](../type-aliases/PresenceChannel)

The channel name, or a resolver over the component instance.

## Returns

A field decorator that registers the presence binding.

(`value`, `context`) => `void`

## Remarks

The channel is resolved per-instance: pass a static string, or a `(self) => string` resolver
for dynamic rooms. The bound prop is server-controlled — like `@locked`, it is included in the
snapshot but is not client-writable. Applies to a field only.

## Example

```tsx
class RoomHeader extends Component {
  @presence((self) => `room.${self.roomId}`)
  members: PresenceMember[] = [];

  @locked roomId = "";
}
```
