Sources

N sources as a pill of overlapping covers. Open it and the list unfolds in place, numbered to match the citations. AI.

Open playground

About

Sources is a React component in the AI category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { Sources } from "@ashutoshswamy/smoui" and set sources, label, defaultOpen.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { Sources } from "@ashutoshswamy/smoui";

<Sources sources={[{ id: "1", title: "Spring physics", domain: "motion.example.org", href: "https://motion.example.org" }]} />

Props 3

sources

The list. With an href a row becomes a link.

{ id; title; domain; href? }[]
label

Word after the count. Default sources.

string
defaultOpen

Start expanded.

boolean