Blockquote
Words quoted from someone else, set in running text or on their own, with an optional attribution.
Usage
import {
Blockquote,
BlockquoteCaption,
BlockquoteFigure,
} from 'nyctoui/blockquote'
<BlockquoteFigure>
<Blockquote cite="https://example.com/handbook">
Write the docs first.
</Blockquote>
<BlockquoteCaption>
— Platform team, <cite>Engineering Handbook</cite>
</BlockquoteCaption>
</BlockquoteFigure>A blockquote is for a quotation: a customer, a support thread, a book. It takes the size and line height of the text around it and sets itself apart with a hairline at its start edge and a quieter color. It isn’t italic: Geist has no italic, and a slanted fallback looks like a rendering fault.
For a tip or a warning of your own, use a Callout; a blockquote tells screen readers the words are someone else’s.
Good for
- A customer quote on a landing page or a case study.
- A quoted reply in a forum post or an email thread.
- A pull quote in a long article in a publishing app.
- An excerpt from a policy or a contract quoted in a help article.
Examples
With an attribution
The attribution goes outside the quote, so wrap both in a BlockquoteFigure and put the name in a BlockquoteCaption. Put the title of a work in a <cite>, and the source’s URL in the quote’s cite attribute.
Pull quote
variant="pull" sets the quote at 20px without a rule, for a quote that stands on its own, like a testimonial on a landing page. Write the quotation marks yourself, as typographic ones.
Accessibility
<blockquote> marks the text as a quotation, and <figure> with <figcaption> ties the attribution to it. Don’t use a blockquote only to indent or highlight text.
Best practices
- Name the source when you know it, with
BlockquoteFigureandBlockquoteCaption, so the attribution is marked up apart from the quote. - Quote the words as they were said, and trim with an ellipsis rather than rewording.
- Use the pull quote variant sparingly, once in an article at most, to lift one line out of the text.
- Use a blockquote for your own tip or warning. That’s a callout.
- Type the attribution into the quote itself, or wrap it in a
<footer>, which screen readers list as a page footer.
API reference
Blockquote
A <blockquote>. Other props, such as cite, go to the element.
| Prop | Type | Default |
|---|---|---|
variantInside running text against a hairline, or larger and on its own. | 'rule' | 'pull' | 'rule' |
sxStyleX styles merged after the built-in ones. | StyleXStyles | — |
BlockquoteFigure
A <figure> holding the quote and its caption. Other props go to the element.
| Prop | Type | Default |
|---|---|---|
sxStyleX styles merged after the built-in ones. | StyleXStyles | — |
BlockquoteCaption
A <figcaption> in 14px tertiary text. Other props go to the element.
| Prop | Type | Default |
|---|---|---|
sxStyleX styles merged after the built-in ones. | StyleXStyles | — |