# Hooks (/themes/sdk/reference/inbox/hooks)

```ts
import { … } from '@poltura/theme-sdk/inbox';
```

## `useInbox` [#useinbox]

The chat's view and actions: whether it is open, online or unread, the conversation, the help search and the merchant's wording and look.

```ts
useInbox(): InboxState
```

Call it inside [`InboxRoot`](/themes/sdk/reference/inbox/parts-1#inboxroot), which exists only where the store offers chat; the default [`InboxWidget`](/themes/sdk/reference/inbox/defaults#inboxwidget) already provides it.

**Returns:** The chat's view and the actions the shopper can take.

**Example**

```tsx
import { InboxRoot, useInbox } from '@poltura/theme-sdk/inbox';

function UnreadDot() {
  const { view, actions } = useInbox();
  if (view.open || view.unread === 0) return null;
  return (
    <button type="button" onClick={actions.open}>
      {view.copy.unread(view.unread)}
    </button>
  );
}

export function ChatNotice() {
  return (
    <InboxRoot>
      <UnreadDot />
    </InboxRoot>
  );
}
```
