collaboration — wyrd.component.comment

Comment

Presentational comment leaf with host-owned author, timestamp, body, decision marker, and edit/delete events.

Install @wyrd-company/react or the Flutter package and use it directly — your DESIGN.md does the styling.

01

Examples

Generated from the contract's examples block. Previews are the published @wyrd-company/react component, themed by the brand's role tokens — flip the site's light/dark toggle and they follow.

Code target Applies to every example on component pages.
default state: default
Usage
import { WyrdComment } from "@wyrd-company/react";

<WyrdComment commentId="comment-1" authorId="author-casey" authorName="Casey" timestamp="2026-07-04T16:00:00.000Z" timestampLabel="Today at 4:00 PM" body="Primary action is in the right place." decision="none" />

// events: onEdit, onDelete
decision state: default
Usage
import { WyrdComment } from "@wyrd-company/react";

<WyrdComment commentId="comment-2" authorId="author-rin" authorName="Rin" timestamp="2026-07-04T16:15:00.000Z" body="Delay copy should identify the affected service window." decision="request-changes" edited />

// events: onEdit, onDelete
actionable state: actionable
Usage
import { WyrdComment } from "@wyrd-company/react";

<WyrdComment commentId="comment-3" authorId="author-mara" authorName="Mara" timestamp="2026-07-04T16:20:00.000Z" body="Locked coordinator field matches this scenario." canEdit canDelete />

// events: onEdit, onDelete
02

Properties

NameTypeDefaultSummary
comment-id string undefined Opaque host-supplied comment identifier.
author-id string undefined Opaque host-supplied author identifier with no authentication semantics.
author-name string undefined Host-supplied display name for the author.
timestamp string undefined Host-supplied ISO timestamp or already-portable timestamp string.
timestamp-label string undefined Optional host-formatted timestamp display string.
body-format plain-text plain-text Body format discriminator; v1 renders plain text only.
body string undefined Plain text comment body.
decision none | approve | request-changes | comment | suggestion none Optional review disposition marker.
edited boolean false Host-supplied edited marker.
can-edit boolean false Shows an edit affordance when true.
can-delete boolean false Shows a delete affordance when true.
03

Slots & events

EventPayloadSummary
edit comment-id Emitted when the user activates the edit affordance.
delete comment-id Emitted when the user activates the delete affordance.
04

Tokens

The contract's token bindings. Open the shared contextual sidebar from any example; primary swatches reflect the color you pick there. Error swatches show the active preset's values; editing any knob switches to custom and resets error to TWW · Ink.

BindingToken
background color.surface
foreground color.on-surface
muted color.on-surface-variant
border-color color.outline
action-background color.surface-container
decision-background color.secondary
decision-foreground color.on-secondary
radius rounded.md
padding-x spacing.md
padding-y spacing.sm
gap spacing.xs
05

States

StateSourceSummary
default platform Comment is visible.
actionable property Edit or delete affordances are visible.
06

Accessibility

From the contract's accessibility obligations. Role article; Author name and timestamp identify the comment; the body provides comment content.

  • Tab moves to edit/delete affordances when present.
  • Enter or Space activates focused edit/delete affordances.
  • The comment root exposes article semantics.
  • Timestamp renders with a dateTime value when the host supplies an ISO timestamp.
  • Edit/delete affordances are buttons named by component-owned localized messages.
  • Decision and edited markers render as text so assistive technology receives the same information as sighted users.
  • Verified under: rtl, reduced-motion, cvd-deuteranopia, density-compact, text-expansion.
07

SDUI

Status: serializable. Comment serializes host-owned comment data and edit/delete bindings. Hosts own permission decisions and persistence.

SerializableMembers
Propertiescomment-id, author-id, author-name, timestamp, timestamp-label, body-format, body, decision, edited, can-edit, can-delete
Slots
Eventsedit, delete
The Wyrding Way — a contract-first design system. © Wyrd Company