QuoteBlock
SM, under 950B gzippedA real blockquote/cite pair, not a styled div.
- Category
- Data display
- Budget
- sm, single-purpose control
- Runtime deps
- None
Preview
The Analytical Engine has no pretensions to originate anything.
This is the exact fixture the conformance suite renders in CI. Switch the language to see the component mirror and reformat.
Install
npx shadcn@latest add https://kata-ui-rho.vercel.app/r/quote-block.jsonCopies the source into your project. Pulls in 1 primitive: cn.
Source
import { cn } from "../lib/cn";
export interface QuoteBlockProps {
children: React.ReactNode;
citation?: string;
className?: string;
}
/**
* `<blockquote>` with `<cite>` for the attribution — a border-left visual
* treatment on a plain `<div>` carries none of this to a screen reader,
* which announces `<blockquote>` as a distinct region.
*/
export function QuoteBlock({ children, citation, className }: QuoteBlockProps) {
return (
<figure className={cn("border-s-4 border-neutral-300 ps-4 text-start dark:border-neutral-700", className)}>
<blockquote className="text-neutral-800 italic dark:text-neutral-200">{children}</blockquote>
{citation && <figcaption className="mt-2 text-sm text-neutral-500 dark:text-neutral-400">— {citation}</figcaption>}
</figure>
);
}
What CI checks
- Bundled, minified and gzipped against its tier budget
- Audited by axe in the state previewed above
- Rendered through react-dom/server with no browser globals
- Scanned for network calls, dangerous sinks, and unguarded animation