Testimonials block
Quotes with their authors, as figures with blockquotes.
SourceStyles source@monoline/react 0.5.0Markdown for AI toolsbeta
- Built on native elements
- Each quote is a figure with a blockquote and a figcaption.
- Avatars are decorative and hidden from assistive technology.
- Styles in one file:
container.css
Import
import '@monoline/css';
import {BlockTestimonials} from '@monoline/react';
Not installed yet? Pick a route.
Copies the source and its styles into your project.
npx monoline add block-testimonials
Usage
import {BlockTestimonials} from '@monoline/react';
<BlockTestimonials
title="What people say"
items={[
{quote: 'It stayed out of the way and the pages got simpler.', name: 'Ada Example', role: 'Engineer, Example Co'},
{quote: 'Keyboard support worked on day one.', name: 'Sam Sample', role: 'Designer, Sample Studio'},
{quote: 'We deleted a lot of CSS.', name: 'Robin Placeholder', role: 'Founder, Placeholder'},
]}
/>
Examples
Three quotes
Props
BlockTestimonialsProps
| Prop | Type | Default | Description |
|---|---|---|---|
title required | ReactNode | – | Section heading shown above the quotes. |
items required | Testimonial[] | – | The quotes to show, each with `quote`, `name` and optional `role` and `avatar`. |
headingLevel | 1 | 2 | 3 | 4 | 5 | 6 | 2 | Outline level of the section title, 1 to 6. Default 2. |
Data Attributes
State is exposed through attributes. Style it with these selectors, not with class toggles.
This component sets no state attributes.
CSS classes
| Class | Stylesheet |
|---|---|
.container | container.css |
.container-full | container.css |
.container-page | container.css |
.container-text | container.css |
.heading | heading.css |
.heading-display | heading.css |
.heading-lg | heading.css |
.heading-md | heading.css |
.heading-sm | heading.css |
.heading-xl | heading.css |
.block-testimonial | block-testimonials.css |
.block-testimonial-avatar | block-testimonials.css |
.block-testimonial-name | block-testimonials.css |
.block-testimonial-role | block-testimonials.css |
.block-testimonials | block-testimonials.css |
.block-testimonials-grid | block-testimonials.css |
.block-testimonials-title | block-testimonials.css |
Customization
Style it with the kit's tokens in your own CSS, loaded after @monoline/css. Prefer the attributes above over extra classes. See Theming for every token.
app.css
.container {
border-color: var(--accent);
}
Accessibility
- Each quote is a figure with a blockquote and a figcaption.
- Avatars are decorative and hidden from assistive technology.