component :: Testimonial
The .testimonial component is a quote with attribution: a figure wrapping mCSS’s already-styled blockquote, plus an Avatar byline. Pure HTML and CSS.
We deleted four hundred lines of utility classes the week we switched. The cascade does the work now.
SM
Sonny MuellerDesign lead, Acme
Playground
We deleted four hundred lines of utility classes the week we switched.
SM
Sonny Mueller
Design lead, Acme
Content
Byline
Copied!
<figure class="testimonial">
<blockquote class="testimonial_quote">
<p>We deleted four hundred lines of utility classes the week we switched.</p>
</blockquote>
<figcaption class="testimonial_byline">
<div class="avatar avatar-sm">
<div><span>SM</span></div>
</div>
<div>
<span class="testimonial_name">Sonny Mueller</span>
<span class="testimonial_role">Design lead, Acme</span>
</div>
</figcaption>
</figure>HTML
<figure class="testimonial"> <blockquote class="testimonial_quote"> <p>We deleted four hundred lines of utility classes the week we switched.</p> </blockquote> <figcaption class="testimonial_byline"> <!-- avatar markup, see the Avatar docs --> <div> <span class="testimonial_name">Sonny Mueller</span> <span class="testimonial_role">Design lead, Acme</span> </div> </figcaption></figure>Custom properties
| Property | Description |
|---|---|
--testimonial-role-color |
Role text color. |
The quote itself is themed by the blockquote element styles.
Astro component
| Prop | Type | Default | Description |
|---|---|---|---|
name |
string |
— | Who said it. Required (also feeds the Avatar initials when there is no photo). |
role |
string |
undefined |
Title/company line. |
avatarSrc |
ImageMetadata | string |
undefined |
Photo for the Avatar. |
class |
string |
undefined |
Additional CSS classes. |
The default slot is the quote.
Examples
A wall of quotes is just testimonials on the grid:
The copy-paste model means I actually own my components.
ACAda ChenFreelanceReadable class names. Imagine that.
SOSam OrtizShipped our marketing site in a weekend.
MKMia KimFounder, Studio K---import Testimonial from "../components/Testimonial.astro";---<div class="grid" col="1" col-md="3"><Testimonial name="Ada Chen" role="Freelance"><p>The copy-paste model means I actually own my components.</p></Testimonial><!-- … --></div>