@pmcollab/coworkstream-native
v0.2.0
Published
Native (React Native / Expo) Work Stream list component for CoWorkStream. Mirrors the prop contract of @pmcollab/coworkstream but renders RN primitives.
Downloads
39
Maintainers
Readme
@pmcollab/coworkstream-native
Native (React Native / Expo) Work Stream list component for CoWorkStream.
Mirrors the prop contract of @pmcollab/coworkstream so a
mobile app can render the same data shape that the web app does, against
the same backend, with no protocol differences.
The web package renders DOM elements (
<section>,<div>, …) plus Tailwind CSS. React Native has no DOM, so this is a separate implementation that swaps inView/Text/Pressable/FlatListand styles withStyleSheet. The two packages stay in lockstep on the public prop API.
Install
npx expo install @pmcollab/coworkstream-native @pmcollab/coworkstream-licensereact and react-native are peer deps and come from your Expo project.
Quick start
import { WorkStream } from '@pmcollab/coworkstream-native'
const items = [
{
id: 'a',
category: 'decision',
priority: 'high',
title: 'Approve Q2 capacity plan',
subtitle: 'Engineering blocked until Friday',
summary: 'Engineering needs a final answer by Friday.',
icon: '✋',
iconBg: '#ef4444',
deadlineAt: '2026-05-22T17:00:00Z',
},
]
export default function InboxScreen() {
return (
<WorkStream
items={items}
onAction={(action, item) => console.log('action', action, item.id)}
renderDetails={(item) => (
<Text style={{ color: '#475569' }}>{item.summary}</Text>
)}
/>
)
}Prop contract
The same props as
@pmcollab/coworkstream
are supported:
items,filters,activeFilter/onFilterChange,expandedId/onExpandChangeisLoading,renderLoading,renderEmptyState,renderHeaderonAction,onItemClick,onOpenFullDetailsrenderDetails(item),renderActions(item, { onAction })deferredIds,onDeferToDesktop,onClearDeferred— same shape as the web package; useful when a paired web app exists. Pure-mobile deployments can ignore them.labels— same string overrides as the web package.
Native-only additions:
theme— accepts a partial theme object. The default palette matches the webslatefamily so screenshots look like siblings. Seesrc/theme.jsfor the full shape.style,contentContainerStyle— RNStyleProp<ViewStyle>overrides.
Native-only differences:
isMobiledefaults totrue. The desktop-only deferral UX collapses to "hide desktop items by default"; pass deferral state if you want to surface a paired web app's queue.- No DOM-only props (e.g.
className,mobileFullscreenon the modal — the modal uses RN'spresentationStyle="pageSheet"instead).
State adapter
Both @pmcollab/coworkstream-store (Zustand) and
@pmcollab/coworkstream-react-query (TanStack Query) work on React Native
without modification. The realtime client
(@pmcollab/coworkstream-realtime/client) works too:
- WebSocket transport (
transport: 'ws') — works on RN natively. Recommended. - SSE transport (default on web) — RN does not ship
EventSource. Installreact-native-sseand set it asglobal.EventSourceat app startup if you want SSE.
Licensing
@pmcollab/coworkstream-license is a peer dep. Call setLicenseKey()
during app startup in production builds. In dev (Expo Go, __DEV__),
license checks are bypassed so trials and design partners can evaluate
without friction.
The default unlicensed-fallback is a native View (the web fallback is a
<div> — that would crash on RN, so this package ships its own).
Releasing
Published as part of the frontend tier alongside @pmcollab/coworkstream.
Add a changeset under .changeset/ for any change to this package and
follow the standard CoWorkStream release flow (see Docs/Internal/RELEASING.md).
Status
Initial 0.1.0 release. The shipped prop surface mirrors the web package's
public API as of @pmcollab/[email protected]. Rendering tests under a
dedicated RN testing harness are tracked as a follow-up.
