Ballmac UI home

Writing Assistant

New

Suggested edits shown in place: the words that could change are marked in the text with a different underline per kind, and each suggestion says what changes, why, and what the text becomes. Accept, Dismiss, Accept all, or edit it yourself.

v1.0.0Updated Oct 25, 2026Ships with a test
What changed

Your draft

Hi Maria, I wanted to reach out because we was thinking that it is very important to basically get the refund sorted out for you as soon as possible. Our team have looked at your order and it seems like the item arrived damaged, which we are really really sorry about.

Suggestions 5

  • Remove: we was Use instead: we were

    The subject and the verb do not agree.

  • Remove: it is very important to basically get the refund sorted out for you as soon as possible Use instead: we will sort out your refund today

  • Remove: Our team have looked Use instead: Our team has looked

  • Remove: it seems like the item arrived damaged Use instead: your item arrived damaged

  • Remove: really really sorry Use instead: sorry

Installation

$ pnpm dlx shadcn@latest add @ballmac/writing-assistant

Usage

import { WritingAssistant, segmentText } from "@/components/ballmac/writing-assistant"

The full example is in the Code tab above.

Examples

Nothing to suggest

Your draft

Hi Maria, your refund of $340 is on its way. It usually takes three to five working days to show on your card.

Suggestions 0

No suggestions. This reads well.

API reference

PropTypeDefault
text

The text. Controlled.

string—
defaultText

The text to start with, for uncontrolled use.

string""
onTextChange(text: string) => void—
suggestions*WritingSuggestion[]—
titlestring—
onAccept

Called when a suggestion is accepted, after the text has changed.

(suggestion: WritingSuggestion) => void—
onDismiss

Called when a suggestion is dismissed.

(suggestion: WritingSuggestion) => void—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
MarksEach marked phrase is a button named 'Suggestion, <kind>: <words>' with pressed state; the kind is also shown by the underline style (wavy, dotted, dashed, double), never colour alone
ChangesEach card reads as words: 'Remove: …' and 'Use instead: …'; Accept and Dismiss name the words they affect
AnnouncementsAccepting, dismissing and Accept all are announced in a polite live region
EditingA labelled textarea; suggestions pause while editing and say so

Use with AI

suggestions is [{ id, find, replace, reason, kind?: grammar | clarity | tone | length }] (required); the first occurrence of find in the text is the one marked. text / defaultText / onTextChange, title, onAccept(suggestion), onDismiss(suggestion). Accept replaces the words and drops the suggestion; Accept all applies them all without the edits disturbing each other; one whose words are no longer in the text, or that overlaps an earlier one, is left out. Exports segmentText. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Writing Assistant (@ballmac/writing-assistant) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • An AI proofreading or rewriting pass over a short piece of text
  • Any place where a model proposes small edits a person should approve one by one

Not for

  • A full rich-text editor; use rich-text-editor
  • Comparing two prompts word by word; use prompt-diff

Registry JSON: https://ui.ballmac.com/r/writing-assistant.json

Credits

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.