Skip to content
Focsd homeFocsd homeFocsd
Forms

Message actions

A toolbar for one reply: copy, retry and good or bad response.

  • Tag: focsd-message-actions
  • Pattern: Toolbar
  • Category: AI

Example

HTML
<focsd-message-actions
for="demo"
text="A feed announces one reply at a time."></focsd-message-actions>

Usage

Import the module once, then use the tag like any HTML element. Every framework below renders the same element; see Frameworks for setup.

<script type="module">
import '@focsd-dev/ai';
</script>
<focsd-message-actions for="demo" text="A feed announces one reply at a time."></focsd-message-actions>

API

Attributes

AttributePropertyTypeDefault
forforstring—
texttextstring—
actionsactionsstring | string[]copy,retry,feedback
feedbackfeedbackFeedbackValuenull

CSS parts

Style the inside of the component with ::part(), for example focsd-message-actions::part(toolbar).

PartDescription
toolbarThe toolbar.
actionEach action (the copy button element and the native buttons).

Accessibility

  • A role="toolbar" named "Message actions" with one tab stop; the arrow keys, Home and End move between the actions (mirrored in right-to-left text).
  • Copy is focsd-copy-button and says "Copied". Retry fires focsd-retry with the message id.
  • The thumbs are toggle buttons with aria-pressed; choosing one announces "Marked as a good response" or "Marked as a bad response", and taking it back announces "Feedback removed". It fires focsd-feedback with value of up, down or null.

Keyboard

KeyAction
Arrow Left / RightMove between the actions
Home / EndFirst / last action
Enter / SpaceUse the action