UI.MD

Quote

A quote with who said it. Plain on any surface, a card for a row of testimonials whose names line up, or a large featured pull quote.

Installation

$
npx shadcn@latest add https://ui.mattdowney.com/r/quote.json

Usage

import { Quote, QuoteText, QuoteAuthor } from "@/components/ui/quote"

Examples

Plain

No box, so it stands on any surface: a sign-in aside, a section, a sidebar.

We used to find out about overruns at month end. Now it's a yellow badge on Tuesday.
Priya RamanStudio lead, Northlight Creative

Avatar, logo and mark

Pass an Avatar element and a logo to the author. mark adds a quiet quote mark above the words.

Our leads log hours between meetings instead of on Friday from memory.
MW
Marcus WebbOperations director, Anchor & Co
Anchor

Row of testimonials

variant="card" puts each quote on a Card. The words take the free height, so the names line up across the row however long each quote runs.

Copperleaf tells us at 80%, while there's still time to have the conversation with the client.
Dana OkaforFounder, Fieldnote Studio
Nobody wants to be the one who pushes the budget bar into red, so hours get logged the same day.
Marcus WebbOperations director, Anchor & Co
Invoicing took a full day. Now it takes an hour.
Priya ChandraStudio manager, Northlight Creative

Featured

size="lg" for one pull quote in a band. Cap its width so the lines stay short.

It's the same numbers we were already tracking, so month-end invoicing went from a day to an hour.
PC
Priya ChandraStudio manager, Northlight Creative

API Reference

PropTypeDefaultDescription
variantQuote"plain" | "card""plain"card for one quote in a row of them. Its className goes on the Card.
sizeQuote"default" | "lg""default"lg for one featured pull quote: 24px words and a wider gap to the author.
markQuotebooleanfalseA quiet neutral quote mark above the words, hidden from screen readers.
citeQuoteTextstring-The source URL, when there is one. A native blockquote attribute.
name*QuoteAuthorReactNode-Who said it.
roleQuoteAuthorReactNode-Their job and company, under the name.
avatarQuoteAuthorReactNode-An Avatar element, sized by you.
logoQuoteAuthorReactNode-A company logo at the far end of the row. Give it a height and alt text.
variantQuote"plain" | "card" = "plain"card for one quote in a row of them. Its className goes on the Card.
sizeQuote"default" | "lg" = "default"lg for one featured pull quote: 24px words and a wider gap to the author.
markQuoteboolean = falseA quiet neutral quote mark above the words, hidden from screen readers.
citeQuoteTextstringThe source URL, when there is one. A native blockquote attribute.
name*QuoteAuthorReactNodeWho said it.
roleQuoteAuthorReactNodeTheir job and company, under the name.
avatarQuoteAuthorReactNodeAn Avatar element, sized by you.
logoQuoteAuthorReactNodeA company logo at the far end of the row. Give it a height and alt text.