ComposerFormat
Island holding a composer's formatting buttons.
View code
<Composer method="post" action="/messages">
<Composer.Input name="body" aria-label="Message" placeholder="Select a word, then press ⌘B" />
<Composer.Toolbar>
<ComposerFormat
labels={{
bold: "Bold",
italic: "Italic",
strike: "Strikethrough",
code: "Code",
link: "Link",
quote: "Quote",
list: "List",
}}
/>
<ComposerSubmit labels={{ send: "Send message", stop: "Stop" }} />
</Composer.Toolbar>
</Composer>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Usage
import { ComposerFormat } from "@sdxc/ui/chat";Renders a row of small ghost buttons. Each edit goes through the browser's editing commands, so Undo reverts it, and leaves the formatted text selected or the caret between new markers. Mod+B, Mod+I, Mod+Shift+X and Mod+E work while the field has focus.
Props
Read from the component's own types, so every prop, every default and every allowed value is listed.