Insight Cards
Install: npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/insight-cards.json
When to use
Browse a small carousel of summaries and native metric-card slots.
Key props and data
| Native prop | Meaning |
|---|---|
pages | A nonempty array of key, prose, Card (component type) and pill. |
labels | Translate the title displayed beside the page count. |
Interaction and state checks
Provide Card as a React component, not an instantiated element. Check previous/next navigation and the interactions inside each card. Remount when replacing the page collection.
Integration boundaries
Default charts and metrics are demo data, not connected analytics. Empty pages are not supported by the pinned native implementation.
The runnable usage and source reference below preserve the native API. These practical guides do not claim a full translation of upstream prose.
Runnable usage
Install a complete example below first, then import its installed entry. Parameterized example source, shared helpers, native components and CSS are included; no manual relative-import edits are required.
import Demo from '@/components/beautiful-ui/examples/presets/insight-cards-custom-insight';
import '@/styles/beautiful-ui.css';
export default function Example() { return <Demo />; }
Preview states
Default, Custom insight
Demo state and mock data do not provide a backend service. Inspect the component props before wiring real data.
Paged agent insights with scrub-ready live charts.
Complete example installation
These are runnable native states and parameterized usage scenarios, not additional components. Each bundle includes its source closure, helpers, pinned dependencies, independent CSS and licenses. Scenario names are not new native component props; consult the source API below.
Default
npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/insight-cards/insight-cards-default.json
Default import: @/components/beautiful-ui/examples/presets/insight-cards-default
Dependencies: clsx@2.1.1, liveline@0.0.7, tailwind-merge@3.6.0, shadow-plugin@2.1.1
Custom insight
npx shadcn@latest add https://jiguang132.com/r/beautiful-ui/examples/insight-cards/insight-cards-custom-insight.json
Default import: @/components/beautiful-ui/examples/presets/insight-cards-custom-insight
Dependencies: clsx@2.1.1, liveline@0.0.7, tailwind-merge@3.6.0, shadow-plugin@2.1.1
Initialize Tailwind CSS v4, import beautiful-ui.css once and synchronize theme with the host html dark class. Examples read html lang for Chinese/English and do not supply backend, authentication or recording. Network/clipboard availability still depends on the browser.
Source-backed parameter reference
Implementation signatures and types are generated from the pinned local source. Optional props, native inherited types, union branches and never exclusions are preserved. A forwardRef implementation's ref is a React reference, not an additional business prop.
InsightCards({
pages = PAGES,
labels,
}: {
variant?: string;
pages?: InsightPage[];
labels?: Partial<InsightCardsLabels>;
} = {})
export type InsightPage = {
key: string;
prose: React.ReactNode;
Card: React.ComponentType;
pill: string;
};
export type InsightCardsLabels = {
/** carousel heading shown before the page count */
title: string;
};
Destructuring defaults in source
Only defaults written directly in parameter/props destructuring are listed. Conditional expressions, runtime theme and computed values require source inspection; this is not an exhaustive behavior-default list.
// InsightCards
pages = PAGES
Native and external types
External types remain defined by React or native dependencies, not manually expanded into guessed props. The installed version's TypeScript definitions are authoritative.
React.ReactNode
React.ComponentType
Partial<InsightCardsLabels>