BlockQuote
Group: Text
Description
A BlockQuote sets a quoted passage apart from your own prose,
usually indented, sometimes with a decorative bar, depending on
the theme. Use it for reviews, testimonials, quoted messages, or
any text your app repeats from another voice.
Syntax
BlockQuote(cite, text)
Parameters
| Parameter | Type | Default | Meaning |
|---|---|---|---|
cite |
str or None |
required | The URL the quote comes from, recorded invisibly for the curious. Pass None when there is no source URL. |
*content |
strings or components | required | The quoted text. |
Examples
from drafter import *
from dataclasses import dataclass
@dataclass
class State:
pass
@route
def index(state: State) -> Page:
return Page(state, [
Header("What Our Customers Say"),
BlockQuote(None,
"Five stars. The corgi at the counter "
"approved my order personally."),
"- A satisfied visitor"
])
start_server(State())
Notes
- The
citeURL comes first and is required, which surprises people;Noneis the normal value for quotes without a web source. - The attribution line ("- A satisfied visitor") goes outside the quote, as ordinary content, because it is your voice rather than the quoted one.
- For a short quotation inside a sentence, use the
InlineQuotationcomponent from the inline text family instead.
Related components
- Paragraph: ordinary prose blocks.
- Inline text semantics:
InlineQuotationfor quotes within a line.