testimonial-card
A quote from a customer, with who said it: their name, their role or company (byline), and their picture (or initials). Marked up as a <figure> with a <blockquote> and a <figcaption>.
This one has no events: it shows what it's given.
Source: testimonial-card.zb, and its registry item.
Install
npx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/testimonial-card.jsonpnpm dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/testimonial-card.jsonyarn dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/testimonial-card.jsonbunx --bun shadcn@latest add https://zubra-js.github.io/zubra-ui/r/testimonial-card.json
npx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/testimonial-card.jsonpnpm dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/testimonial-card.jsonyarn dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/testimonial-card.jsonbunx --bun shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/testimonial-card.json
npx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/testimonial-card.jsonpnpm dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/testimonial-card.jsonyarn dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/testimonial-card.jsonbunx --bun shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/testimonial-card.json
<link rel="stylesheet" href="https://zubra-js.github.io/zubra-ui/themes/default.css">
<script type="module" src="https://zubra-js.github.io/zubra-ui/cdn/testimonial-card.js"></script>The compiled install writes src/components/zubra/testimonial-card.js and the theme, and adds @zubra/runtime to your dependencies. The one-file install writes the same path as a plain custom element that needs nothing installed (or download it and load it with a <script type="module">); it's smaller on a page with one to three components, the shared runtime with more.
Usage
<testimonial-card name="Priya Raman" byline="Owner, Rise & Crumb">
We cut our morning prep by an hour. The timers alone paid for it in a week.
</testimonial-card>
<script type="module">
import './components/zubra/testimonial-card.js';
</script>import './components/zubra/testimonial-card.js';
export function TestimonialCardExample() {
return (
<testimonial-card name="Priya Raman" byline="Owner, Rise & Crumb">
We cut our morning prep by an hour. The timers alone paid for it in a week.
</testimonial-card>
);
}<script setup>
import './components/zubra/testimonial-card.js';
</script>
<template>
<testimonial-card name="Priya Raman" byline="Owner, Rise & Crumb">
We cut our morning prep by an hour. The timers alone paid for it in a week.
</testimonial-card>
</template>
<!-- vite.config.js: vue({ template: { compilerOptions: { isCustomElement: (tag) => tag.includes('-') } } }) --><script>
import './components/zubra/testimonial-card.js';
</script>
<testimonial-card name="Priya Raman" byline="Owner, Rise & Crumb">
We cut our morning prep by an hour. The timers alone paid for it in a week.
</testimonial-card>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import './components/zubra/testimonial-card.js';
@Component({
selector: 'app-testimonial-card-example',
schemas: [CUSTOM_ELEMENTS_SCHEMA],
template: `
<testimonial-card name="Priya Raman" byline="Owner, Rise & Crumb">
We cut our morning prep by an hour. The timers alone paid for it in a week.
</testimonial-card>
`,
})
export class TestimonialCardExample {
}API
| Property | Type | Default |
|---|---|---|
name | string | "" |
byline | string | "" |
src | string | "" |
| Slot | For |
|---|---|
(default) | The quote. |
Size
1.2 KB gzipped for the component, plus the runtime, which every Zubra component on a page shares (up to 22.1 KB, all of it). On its own, with the parts of the runtime it uses, it's 17.7 KB.