Skip to content
Get started

Components

TestimonialCard

Unstable: a real, attributed customer quote in a figure, with the person's name, job and avatar. Import it from @nizivo/react/unstable/testimonial-card.

Server component, no client JSUnstable

Examples

Basic

A quote with its author. Use real, attributed quotes only; this copy is a placeholder.

We rebuilt our checkout in two weeks and the accessibility review came back clean the first time.
Maya LindqvistFounder, Moss & Kiln
import type { JSX } from 'react';
import { Avatar } from '@nizivo/react/avatar';
import { TestimonialCard } from '@nizivo/react/unstable/testimonial-card';

export function TestimonialCardExample(): JSX.Element {
  return (
    <TestimonialCard
      quote="We rebuilt our checkout in two weeks and the accessibility review came back clean the first time."
      name="Maya Lindqvist"
      jobTitle="Founder, Moss & Kiln"
      avatar={<Avatar name="Maya Lindqvist" size="lg" decorative />}
    />
  );
}

Import

import { TestimonialCard } from '@nizivo/react/unstable/testimonial-card';

// Once per app (Getting started), after
// @nizivo/tokens/tokens.css and @nizivo/react/css/base.css
import '@nizivo/react/css/testimonial-card.css';

Static or interactive

Server. No client JavaScript. How to choose.

Use

quote is a <blockquote> (cite takes its source) and name, jobTitle and avatar are its <figcaption>. The quote mark is decoration. Use real, attributed quotes only.

Props

Server component Renders data-slot="testimonial-card" with the class nz-testimonial-card. Props: TestimonialCardProps. Source: src/unstable/testimonial-card/testimonial-card.tsx.

NameTypeDefaultDescription
avatarReactNode–

An Avatar (lg); decorative, since the name is printed beside it.

citestring–

The quote's source, a URL, for <blockquote cite>.

jobTitleReactNode–

Their job and company: "Founder, Moss & Kiln".

namerequiredReactNode–

Who said it.

quoterequiredReactNode–

The quote, as said.

renderRenderProp<Record<string, never>>–

Must render a <figure>.

  • Also takes every attribute of <figure> except children. (Omit<ComponentPropsWithRef<"figure">, "children">)

render takes an element, or, in client code, a function of the props and no state.

Other exports

TestimonialCardProps type

import type { TestimonialCardProps } from '@nizivo/react/unstable/testimonial-card'

The props of TestimonialCard, listed above.

Data attributes and slots

Style parts by class (.nz-<slot>) and state by data attribute. Attribute meanings come from contracts/vocabulary.json.

SlotRendered byData attributes
testimonial-card
.nz-testimonial-card
TestimonialCard
root (takes render)
none
testimonial-card-author
.nz-testimonial-card-author
TestimonialCard
inner element (CSS only)
none
testimonial-card-quote
.nz-testimonial-card-quote
TestimonialCard
inner element (CSS only)
none

CSS hooks

Set a hook on the component's class or any ancestor to restyle it without specificity games; leave it unset for the default shown.

This stylesheet reads no public hook.

Layers: nz.components. Classes: .nz-testimonial-card, .nz-testimonial-card-author, .nz-testimonial-card-avatar, .nz-testimonial-card-mark, .nz-testimonial-card-name, .nz-testimonial-card-name-block, .nz-testimonial-card-quote, .nz-testimonial-card-role.

Tokens this stylesheet reads (14)

--nz-bg-surface, --nz-border-subtle, --nz-border-width-default, --nz-font-body-l, --nz-font-body-s, --nz-font-label-m-strong, --nz-icon-brand, --nz-radius-xl, --nz-space-1, --nz-space-3, --nz-space-5, --nz-space-6, --nz-text-primary, --nz-text-secondary

Accessibility

Nothing in this component takes focus or keyboard input.

Keyboard

None.

On this page