# React Native team chat template, Slack-style (Pro)

> A React Native team chat for iOS, Android and the web, as Slack lays it out: channels and direct messages in a sidebar, a channel with its topic and members, threads in a side panel, reactions as chips, @mentions, pins, a huddle bar and a formatting composer. Built on Patine Pro's ChannelThread, no native modules.

# Team chat Pro

A workspace chat, as Slack and Teams lay it out. The sidebar lists channels (# or a lock for private ones) and direct messages with faces and presence, bold when unread and with a red count when you're mentioned. The open channel shows its topic and members, and messages as plain rows: the avatar and name head each run, day dividers, a red **New messages** line, reactions as chips that toggle yours, and threads as faces and "3 replies · Last reply 5 min ago". Open a thread and its replies sit in a panel beside the channel, with **Also send to #design**. Hover a message on the web for quick reactions, Reply in thread and its menu; on phones, long-press it. Start a huddle from the header and a green bar keeps its clock, mute and Leave. On phones the sidebar, the channel and the thread are pushed one after another.

It's built from [ChannelThread](../blocks/messenger#team-chat) and free components, so every part is yours to change.

```tsx
import { TeamChatScreen } from '@patine-ui/pro';

<TeamChatScreen />;
```

```tsx live full
import { View } from 'react-native';
import { TeamChatScreen } from '@patine-ui/pro';

export default function Example() {
  return (
    <View style={{ width: '100%', height: 680 }}>
      <TeamChatScreen />
    </View>
  );
}
```

## Make it yours

The demo reads `TEAM_CHANNELS`, `teamMessages(now)` and `teamReplies(now)`, and `useTeamChat` stands in for your backend: replying in a thread moves its parent's summary on, and Maya answers. Copy the screen and swap the hook for your API and socket.

| Prop | Type | Default |
| --- | --- | --- |
| `now` | `number`: pins the demo's clock, for tests and screenshots | `Date.now()` |

## Built with

The free components, from `patine-ui`:

[Avatar](/docs/components/avatar) · [AvatarGroup](/docs/components/avatar-group) · [Button](/docs/components/button) · [Checkbox](/docs/components/checkbox) · [EmptyState](/docs/components/empty-state) · [Text](/docs/components/text)

And from Patine Pro:

- [App shell and layout](/docs/pro/layout) PRO
- [Messenger](/docs/blocks/messenger) PRO
- [Patine Icons, the Pro set](/docs/components/icons) PRO

## Files

```text
team-chat/
├── components/
│   ├── ChannelHeader.tsx
│   └── ChannelSidebar.tsx
├── hooks/
│   └── useTeamChat.ts
├── index.ts
├── team-chat.constants.ts
└── TeamChatScreen.tsx
```

## A look at the code

The open channel: its header and the huddle bar, from `TeamChatScreen.tsx`:

```tsx
  const main = channel ? (
    <View style={{ flex: 1 }}>
      <ChannelHeader channel={channel} onBack={desktop ? undefined : s.back} onHuddle={s.huddle ? undefined : s.startHuddle} />
      {s.huddle ? (
        <HuddleBar
          title={`Huddle in ${prefix}${s.channels.find((c) => c.id === s.huddle?.channel)?.name ?? ''}`}
          seconds={s.huddle.seconds}
          muted={s.huddle.muted}
          people={[TEAM_ME, 'maya', 'leo']}
          onToggleMute={s.toggleHuddleMute}
          onLeave={s.leaveHuddle}
        />
      ) : null}
      {/* … the thread, then the replies panel */}
```

Get the source with Pro

## Related

- [Messenger](../blocks/messenger): `ChannelThread`, `MessengerThread`, `ConversationList`, `MessengerComposer` and `ChatDetails`.
- [Notification center](../blocks/notification-center): mentions and activity across channels.
