Editor Comment
Inline comment thread popover for the editor — shows a thread of replies, a reply composer, and a resolve action. `type="suggestion"` leads with the proposed change (deleted → inserted), says "suggested an edit" and replaces resolve with Accept / Reject.
Preview
This paragraph needs a stronger opening sentence.
Resolved
Can we cite the Q2 numbers here?
Resolved
<div class="w-full flex flex-wrap justify-center gap-6 p-6">
<x-ui.editor-comment author="Jordan Lee" time="2h ago" />
<x-ui.editor-comment
author="Priya Nair"
time="Yesterday"
body="Can we cite the Q2 numbers here?"
:replies="[['author' => 'Sam Rivera', 'time' => '20m ago', 'body' => 'Added the link to the report in the next paragraph.']]"
/>
</div>
Installation
php artisan ui:add pro/editor-comment
Note
This component ships an Alpine behavior module at
resources/js/ui/editor-comment.js. Import it once from your bundle so it registers on alpine:init:
import './editor-comment.js';
Use with AI
A brief for your coding agent: install command, usage, props, guidance and the rules. Copy it, or open a prompt about this component in an assistant.
# Brok UI: Editor Comment (`editor-comment`)
Inline comment thread popover for the editor — shows a thread of replies, a reply composer, and a resolve action. `type="suggestion"` leads with the proposed change (deleted → inserted), says "suggested an edit" and replaces resolve with Accept / Reject.
Brok UI is a Laravel Blade component registry. Installed components are plain Blade files the app owns.
## Install
```bash
php artisan ui:add pro/editor-comment
```
## Usage
```blade
<div class="w-full flex flex-wrap justify-center gap-6 p-6">
<x-ui.editor-comment author="Jordan Lee" time="2h ago" />
<x-ui.editor-comment
author="Priya Nair"
time="Yesterday"
body="Can we cite the Q2 numbers here?"
:replies="[['author' => 'Sam Rivera', 'time' => '20m ago', 'body' => 'Added the link to the report in the next paragraph.']]"
/>
</div>
```
## Use when
- Use when users need rich structured authoring, annotation, or collaborative editing controls.
- Attaching an inline comment thread to a piece of editor content, with replies, resolve or reopen, and a composer.
- Presenting a proposed edit as a suggestion, showing the removed and inserted text with Accept/Reject actions, using type="suggestion".
## Avoid when
- Do not use rich editor affordances for simple one-line or plain-text tasks.
- The feedback is not tied to a specific span of document content; use a general comment or activity feed instead. Use blocks/activity-feed-timeline for a general comment or activity feed instead.
## Anti-patterns
- Rich editors for one-line or easily validated input
## Rules
- Use the `<brok:editor-comment>` tag (or `<x-ui.editor-comment>`) in Blade; do not rewrite the component.
- Prefer the documented props and variants over utility-class overrides; when a utility must win, use the `!` important modifier.
- Use semantic design tokens (`bg-primary`, `text-muted-foreground`), never raw colour utilities.
- Keep the `data-slot` attributes; they are the styling and test hooks.
## Links
- Docs: https://brokui.dev/docs/components/editor-comment
Working in Claude Code, Cursor or Codex? Give the agent the whole registry through the MCP server or the Brok UI skill.
Examples
Suggestion
<div class="mx-auto max-w-md p-6">
<x-ui.editor-comment type="suggestion" author="Jordan Lee" time="5m ago" deleted="a slow fox" inserted="the quick brown fox" />
</div>
API
Props
No documented props. Pass normal Blade attributes through the component root.
Slots
default—
Data slots
Stable hooks for CSS overrides and browser tests.
No data-slot selectors found in the registry source.
Behavior
- type="comment" shows resolve/reopen and stamps state open or resolved; type="suggestion" leads with the deleted-to-inserted diff and replaces resolve with Accept/Reject, stamping state pending, accepted, or rejected.
- Cmd/Ctrl+Enter submits a reply from the composer, which grows to fit its content and reveals its buttons once it has focus or a draft.
- Installs a JavaScript behavior module when the registry item includes resources/js/ui files.
Guidance
Create or revise structured rich content.
Use when
- Use when users need rich structured authoring, annotation, or collaborative editing controls.
- Attaching an inline comment thread to a piece of editor content, with replies, resolve or reopen, and a composer.
- Presenting a proposed edit as a suggestion, showing the removed and inserted text with Accept/Reject actions, using type="suggestion".
Avoid when
- Do not use rich editor affordances for simple one-line or plain-text tasks.
- The feedback is not tied to a specific span of document content; use a general comment or activity feed instead. Use blocks/activity-feed-timeline for a general comment or activity feed instead.
Use instead
- Textarea or plain field for simple content
Anti-patterns
- Rich editors for one-line or easily validated input
- Anatomy
Accessibility
- Keyboard
- No component-owned keyboard interaction; native element behavior applies.
- Focus
none
- Each thread generates a unique draft-field id per instance, so the composer's label always points at the correct textarea even with many threads on one page.
- Semantic HTML and a stable
data-slotattribute for styling and scripting hooks. - Focus-visible rings use the
ringtoken, so keyboard focus is always visible. - Disabled and invalid states are conveyed to assistive tech, not by color alone.
- Targets WCAG 2.2 AA; verify contrast in light, dark, admin and customer surfaces in the preview.
- Labels go through
__()and layout uses logical properties (ms-*,text-start), so it mirrors underdir="rtl"— flip the preview to RTL to confirm. - Dark mode uses the same semantic tokens under the
darkclass; high contrast follows forced-color system tokens.
Livewire
Livewire can update this component through forwarded wire:* attributes.
Source
Source available with Pro
This preview shows the real Pro component, while its installable source is delivered only through the authenticated registry. Activate a license, then use the installation command above.
Open the authenticated source endpoint
Ownership & lifecycle
Owner, release state, review evidence and adoption for this item.
- Owner
- Platform UI (@JoshJML)
- Current version
-
1.3.0 - Status
- Stable
- License
-
pro - Accessibility reviewed
- No review date recorded
- Last breaking change
- No date recorded
- Deprecation
- Not deprecated