# Reactions::ui_state()

Everything the reaction UI shows for one object: the chips with counts and reactors, the viewer's own reaction and flags.

Returned by `Reactions::toggle()` and used by every surface that lists objects, so a feed card and a forum post render the
same data from the same builder.

```php
ui_state( array $def, int $object_id, array $counts, array $user_slugs, ?array $reactor_ids = null ): array
```

## Parameters

- `$def` (array<string, mixed>) Object type definition.
- `$object_id` (int) Object ID.
- `$counts` (array<string, int>) Counts by reaction slug.
- `$user_slugs` (string[]) Reactions the viewer has on the object.
- `$reactor_ids` (array<string, int[]>) Optional preloaded reactor IDs per slug (otherwise asked from the object type).

## Return

`array{reactions_display: array<int, array<string, mixed>>, my_reaction: array<string, mixed>, liked: bool, viewer_can_react: bool}` 

## Changelog

| Version | Description |
| --- | --- |
| 1.6.2 | Introduced |
