Agent Grammar Checker
An intelligent grammar and style checking interface that provides comprehensive text analysis with issue detection and correction suggestions.
Features
- Grammar Analysis: Detect grammar, spelling, and punctuation errors
- Style Suggestions: Improve clarity, tone, and readability
- Issue Management: Accept or reject individual suggestions
- Text Statistics: Word count, readability score, and issue tracking
- Real-time Editing: Live text editing with instant feedback
- Severity Levels: Error, warning, and info classifications
- Issue Categories: Grammar, spelling, style, clarity, and punctuation
- Original Text Comparison: Side-by-side before/after comparison
Examples
Basic Usage
Simple grammar checker with issue detection.
Subject-verb agreement error
Consider using a more active voice
Possible spelling error
Interactive Demo
Full-featured demo with text analysis and correction tools.
Possible spelling error: 'gramatical' should be 'grammatical'
Subject-verb agreement: 'need' should be 'needs'
Incorrect verb form: 'fix' should be 'fixed'
Consider using more formal language
Quick Actions:
Sample Texts:
Chat Integration
Example of how the grammar checker works within a chat conversation:
Grammar Checking Chat
Showing how the grammar checker works in a chat context
I'll analyze your text for grammar and spelling issues.
Use 'They're' (they are) instead of 'Their' (possessive)
Use 'their' (possessive) instead of 'there' (location)
Installation
npx shadcn add "https://agents-ui-kit.com/c/agent-grammar-checker.json"
API Reference
AgentGrammarChecker
Prop | Type | Default | Description |
---|---|---|---|
text | string | "" | Current corrected text |
originalText | string | "" | Original input text |
issues | GrammarIssue[] | [] | Array of detected issues |
stats | GrammarStats | - | Analysis statistics |
isAnalyzing | boolean | false | Whether analysis is in progress |
onTextChange | (text: string) => void | - | Text change callback |
onAcceptSuggestion | (issueId: string) => void | - | Accept suggestion callback |
onRejectSuggestion | (issueId: string) => void | - | Reject suggestion callback |
onCopy | () => void | - | Copy text callback |
onReanalyze | () => void | - | Re-analyze text callback |
onRegenerateResponse | () => void | - | Regenerate callback |
className | string | - | Additional CSS classes |
timestamp | string | "Just now" | Display timestamp |
GrammarIssue
Property | Type | Required | Description |
---|---|---|---|
id | string | Yes | Unique issue identifier |
type | GrammarIssueType | Yes | Issue category |
message | string | Yes | Issue description |
suggestion | string | Yes | Correction suggestion |
position | { start: number; end: number } | Yes | Text position |
severity | "error" | "warning" | "info" | Yes | Issue severity level |
GrammarIssueType
type GrammarIssueType = "grammar" | "spelling" | "style" | "clarity" | "punctuation"
GrammarStats
Property | Type | Required | Description |
---|---|---|---|
wordsCount | number | Yes | Total word count |
readabilityScore | number | Yes | Readability score (0-100) |
issuesFixed | number | Yes | Number of fixed issues |
totalIssues | number | Yes | Total issues detected |
Issue Severity Levels
- Error: Critical issues that affect correctness
- Warning: Important style or clarity improvements
- Info: Minor suggestions for enhancement
Issue Categories
- Grammar: Subject-verb agreement, tense consistency, etc.
- Spelling: Misspelled words and typos
- Style: Word choice, voice, and tone improvements
- Clarity: Sentence structure and readability
- Punctuation: Comma usage, capitalization, etc.