Playground

Testimonials block

Quotes with their authors, as figures with blockquotes.

  • 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

PropTypeDefaultDescription
title requiredReactNode–Section heading shown above the quotes.
items requiredTestimonial[]–The quotes to show, each with `quote`, `name` and optional `role` and `avatar`.
headingLevel1 | 2 | 3 | 4 | 5 | 62Outline 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

ClassStylesheet
.containercontainer.css
.container-fullcontainer.css
.container-pagecontainer.css
.container-textcontainer.css
.headingheading.css
.heading-displayheading.css
.heading-lgheading.css
.heading-mdheading.css
.heading-smheading.css
.heading-xlheading.css
.block-testimonialblock-testimonials.css
.block-testimonial-avatarblock-testimonials.css
.block-testimonial-nameblock-testimonials.css
.block-testimonial-roleblock-testimonials.css
.block-testimonialsblock-testimonials.css
.block-testimonials-gridblock-testimonials.css
.block-testimonials-titleblock-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.