Leftover Text Check

Leftover Text Check is a copy-paste React component that stops chatbot reply published as listing 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/leftover-text-check
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 2 extra npm packages
  • A11y guidance in docs

StopsChatbot reply published as listing

Was this component page useful?

How do I install Leftover Text Check?

pnpm dlx shadcn@latest add @bollard/leftover-text-check

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

How do I use Leftover Text Check in React?

leftover-text-check-usage.tsx
import { LeftoverTextCheck } from "@/components/ui/leftover-text-check"

<LeftoverTextCheck
  id="leftover-demo"
  value={text}
  onValueChange={setText}
  rows={7}
  onPublish={async () => {
    await new Promise((r) => setTimeout(r, 600))
    setPublished(true)
  }}
/>

What input mistakes does Leftover Text Check catch?

  • Chatbot chatter and refusals ("Certainly! Here's…", "I cannot fulfill that request")
  • Unfilled placeholders such as [product], [task 1], XX%
  • TK and TODO markers
  • A paragraph pasted twice
  • Publishing with leftovers: asks for a second press

What props does Leftover Text Check accept?

LeftoverTextCheck props
PropTypeDefault
value

Controlled text.

string—
defaultValue

Initial text when uncontrolled.

string""
onValueChange

Called with the text on every change.

(value: string) => void—
onPublish

Publishes the text. May return a Promise; the button shows a pending state and can't fire twice.

(value: string) => void | Promise<void>—
phrases

Extra sentence patterns to treat as chatter, e.g. your own model's sign-off.

RegExp[]—
maxVisible

Findings listed before a "Show N more" button. Default 4.

number4
duplicates

Flag a paragraph that appears twice. Default true.

boolean—
className

Class for the wrapper; `textareaClassName` styles the field itself.

string—
textareaClassName

Extra classes for the textarea.

string—
messages

Override any visible string, including per-kind finding text.

Partial<Omit<Messages, "kind">> & { kind?: Partial<Record<LeftoverKind, string>> }—

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

How is Leftover Text Check accessible?

  • Textarea gets aria-invalid when leftovers are found and is described by the summary
  • Each finding has text and an icon that is aria-hidden
  • Focus moves to the next finding or back to the field after a fix
  • Animations are skipped under reduced motion

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

What are the limitations and server boundaries?

  • Phrase lists are English-first; extend them with the phrases prop
  • Can't tell intentional brackets or repetition in every case
  • Doesn't check facts or tone

What expensive mistakes does Leftover Text Check stop?

Chatbot reply published as listing

Also known as

ai generated text · chatgpt · product description · blog post · cms editor · textarea · lorem ipsum · tk

Field type

What dependencies does Leftover Text Check require?

Leftover Text Check facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameLeftover Text Check
Registry identifier@bollard/leftover-text-check
Install commandnpx shadcn@latest add @bollard/leftover-text-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, motion
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 Leftover Text Check

What form validation mistake does Leftover Text Check catch?

Leftover Text Check prevents chatbot reply published as listing. Catches chatbot chatter, refusals, unfilled placeholders and TODOs left in text before it is published. Catches: Chatbot chatter and refusals ("Certainly! Here's…", "I cannot fulfill that request"), Unfilled placeholders such as [product], [task 1], XX%, TK and TODO markers, A paragraph pasted twice, Publishing with leftovers: asks for a second press. Limitation: validate leftover-text-check schemas on backend.

How do I install leftover-text-check with shadcn?

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

What props customize Leftover Text Check?

Leftover Text Check accepts `value`, `defaultValue`, `onValueChange`, `onPublish`, `phrases`. Configures ai generated text, chatgpt, product description behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of leftover-text-check?

Phrase lists are English-first; extend them with the phrases prop. Can't tell intentional brackets or repetition in every case. Doesn't check facts or tone Server requirement: backend verification for leftover-text-check.

How does Leftover Text Check meet accessibility guidelines?

Textarea gets aria-invalid when leftovers are found and is described by the summary. Each finding has text and an icon that is aria-hidden. Focus moves to the next finding or back to the field after a fix. Animations are skipped under reduced motion. Minimizes errors: chatgpt text left in post, placeholder published by mistake.

Which components pair with Leftover Text Check?