Components · Data Display
Quote
Text someone else wrote, shown outside Markdown behind the 2px quote bar and in the body text colour, so it reads apart from the values Raft writes around it.
import { Quote } from "@botiverse/raft-ui/wip";Quote shows text that a person or an agent wrote, where Raft shows it outside a message: a task's title in a panel, a note a Worker left, an agent's reason in a request. The quote bar says whose words they are, so they never read as Raft's own label or value beside them.
When to use
Anatomy
Quote: ablockquotebehind the quote bar, holding the quoted text. Required.
The bar is the one every quote in Raft draws: 2px of line-seam on the left and the text 10px after it (Shape). MarkdownBlockquote, MessageQuotedPreview and an action card's hint draw theirs from the same recipe, so every quote bar looks the same. Quote has no fill and no corner.
Whose words they are, a caption or a term, sits outside the quote, in the page's own voice.
Behavior
- The text is in
foreground, the body text colour, and upright: it is the content someone reads, at the base tier (Typography), not helper text. A quoted message is grey because it supports the message it sits under; this text is the thing being shown. - It takes the size and line height of the text around it, so a quote in a description list's value has the value's
text-callout. Set the size on the container, not on the quote. - It keeps the line breaks the writer wrote and breaks a long word or address where it has to, so a pasted path or link never widens its container.
- It takes its whole line, also in a wrapping flex row such as a description list's value, and shrinks with it (
min-w-0).
Content
- Put in it only what a person or an agent wrote, as they wrote it: a title, a description, a note, a reason, a file's name, a value Raft could not check. Don't add to it, trim it or translate it.
- Don't put Raft's own words in it: the panel's terms, a ref, a handle, an id, a status, a time or a command Raft printed are plain text beside it. A label inside the quote bar would read as something someone wrote.
- Name whose words they are outside the quote: a DescriptionList term, a caption or a heading.
- It is text only. Nothing in it is a link or a button: someone else's words can't be one of Raft's controls.
Accessibility
- It is a native
blockquote, which screen readers announce as a quote. - When the quoted text comes from a page with an address, pass it as
cite. Browsers don't show it, so also name the source where people can see it. - To tie a visible caption to the quote, put both in a
figureand the caption in itsfigcaption, as above. In a description list, the term already names it.
Rules
- Show someone else's text with Quote and Raft's own values as plain text, so the two never look alike.
- Keep the body colour. Don't make a Quote grey: grey is for helper text and for the quoted message under a message.
- Use Quote only outside Markdown. Inside rendered Markdown, a quote is
MarkdownBlockquote.
API
Quote
Takes the attributes of its element.