Chat Audience Check

Chat Audience Check is a copy-paste React component that stops secret message reached a stranger in group before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/chat-audience-check
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsSecret message reached a stranger in group

Was this component page useful?

How do I install Chat Audience Check?

pnpm dlx shadcn@latest add @bollard/chat-audience-check

The files land in your project. They're yours to edit.

How do I use Chat Audience Check in React?

chat-audience-check-usage.tsx
import { ChatAudienceCheck, type ChatMember } from "@/components/ui/chat-audience-check"

<ChatAudienceCheck
  conversation="Launch core team"
  organization="Acme"
  members={members}
  now={NOW}
  lastPostedAt="2026-10-11T12:00:00Z"
  defaultValue="Confidential: the launch date moves to 3 Nov. Please don't share outside this group."
  onRemove={(m) => new Promise<void>((resolve) => setTimeout(() => (setMembers((list) => list.filter((x) => x.id !== m.id)), resolve()), 400))}
  onViewProfile={(m) => setLog(`Opened ${m.name}'s profile.`)}
  onSend={(text) => new Promise<void>((resolve) => setTimeout(() => (setLog(`Sent: “${text}”`), resolve()), 500))}
/>

What input mistakes does Chat Audience Check catch?

  • Members whose display name disagrees with what you saved them as
  • Names nobody can identify (initials, blanks)
  • People who joined after your last message
  • People outside your organisation, or marked external by the platform
  • Messages with sensitive terms, which raise the check

What props does Chat Audience Check accept?

ChatAudienceCheck props
PropTypeDefault
value

Controlled message text.

string—
defaultValue

Initial message text when uncontrolled.

string""
onValueChange

Called with the text on every change.

(text: string) => void—
members* (required)

Everyone in the chat, you included (mark yourself with `isYou`).

ChatMember[]—
organization* (required)

Your organisation's name as members' `org` spells it.

string—
conversation* (required)

The chat's name, e.g. "#q4-deals" or "Launch core team".

string—
lastPostedAt

When you last posted here; people who joined later are called out.

Date | string | number—
sensitive

Forces the careful path (a confidential channel, a file marked internal). Otherwise the text decides.

boolean—
sensitiveTerms

Words that make a message worth a second look. Replaces the default list.

string[]DEFAULT_CHAT_SENSITIVE_TERMS
now

Pass for deterministic "joined 2 days ago" text.

Date—
locale

BCP 47 locale for dates.

string"en-IN"
onSend* (required)

Sends the message. Return a promise for a pending state; the text clears when it resolves.

(text: string) => void | Promise<void>—
onRemove

Removes someone from the chat. Without it there's no Remove button.

(member: ChatMember) => void | Promise<void>—
onViewProfile

Opens someone's profile so you can see who they really are.

(member: ChatMember) => void—
sendOnEnter

Enter sends and Shift+Enter adds a line. Off: only Ctrl/⌘+Enter sends.

booleantrue
messages

Override any visible string.

Partial<ChatAudienceCheckMessages>—

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

How is Chat Audience Check accessible?

  • Visible <label>; the textarea is described by the flagged-member list
  • Escape cancels the second-press state; Enter sends only when not composing (IME-safe)
  • Focus moves to the first action in the flagged list
  • Remove buttons set aria-busy; errors use role="alert" and status a role="status" region

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Membership and access to the conversation must be enforced by the chat service; this is a pre-send review.

  • Only as good as the member, contact and organisation data you pass
  • Sensitive-term matching is a word list (replaceable)
  • Sending is still possible after a second press

What expensive mistakes does Chat Audience Check stop?

Secret message reached a stranger in group

Also known as

group chat · members · signal · whatsapp group · slack channel · audience · external member · send confirmation

Field type

What dependencies does Chat Audience Check require?

Chat Audience Check facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameChat Audience Check
Registry identifier@bollard/chat-audience-check
Install commandnpx shadcn@latest add @bollard/chat-audience-check
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Chat Audience Check

What form validation mistake does Chat Audience Check catch?

Chat Audience Check prevents secret message reached a stranger in group. Before a sensitive message goes to a group chat, flags members who don't seem to belong, so it doesn't reach the wrong person. Catches: Members whose display name disagrees with what you saved them as, Names nobody can identify (initials, blanks), People who joined after your last message, People outside your organisation, or marked external by the platform, Messages with sensitive terms, which raise the check. Limitation: validate chat-audience-check schemas on backend.

How do I install chat-audience-check with shadcn?

Run `npx shadcn@latest add @bollard/chat-audience-check`. Sources added: registry/default/chat-audience-check/audience.ts, registry/default/chat-audience-check/chat-audience-check.tsx. Package requirements: lucide-react.

What props customize Chat Audience Check?

Chat Audience Check accepts `value`, `defaultValue`, `onValueChange`, `members`, `organization`. Configures group chat, members, signal behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of chat-audience-check?

Only as good as the member, contact and organisation data you pass. Sensitive-term matching is a word list (replaceable). Sending is still possible after a second press Server requirement: Membership and access to the conversation must be enforced by the chat service; this is a pre-send review.

How does Chat Audience Check meet accessibility guidelines?

Visible <label>; the textarea is described by the flagged-member list. Escape cancels the second-press state; Enter sends only when not composing (IME-safe). Focus moves to the first action in the flagged list. Remove buttons set aria-busy; errors use role="alert" and status a role="status" region. Minimizes errors: wrong person in group chat, journalist added to signal chat.

Which components pair with Chat Audience Check?