
Security News
RubyGems Adds Cooldown Feature to Bundler for Newly Published Gems
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.
@bonnard/react
Advanced tools
React components for embedding Bonnard charts and dashboards in any React app.
npm install @bonnard/react @bonnard/sdk
import { BonnardProvider } from '@bonnard/react';
import '@bonnard/react/styles.css';
function App() {
return (
<BonnardProvider config={{ apiKey: 'bon_pk_...' }}>
<MyAnalyticsPage />
</BonnardProvider>
);
}
import { BarChart } from '@bonnard/react';
function RevenueByCategory() {
return (
<BarChart
title="Revenue by Category"
measures={['orders.revenue']}
dimensions={['orders.product_category']}
/>
);
}
import { useBonnardQuery } from '@bonnard/react';
function OrderStats() {
const { data, loading, error } = useBonnardQuery({
query: {
measures: ['orders.revenue', 'orders.count'],
dimensions: ['orders.status'],
},
});
if (loading) return <p>Loading...</p>;
if (error) return <p>Error: {error}</p>;
return (
<ul>
{data?.map((row, i) => (
<li key={i}>{row['orders.status']}: ${row['orders.revenue']}</li>
))}
</ul>
);
}
All chart components accept data inline or query props:
| Component | Description |
|---|---|
<BarChart> | Vertical or horizontal bar chart |
<LineChart> | Line chart with optional time axis |
<AreaChart> | Stacked or overlapping area chart |
<PieChart> | Pie / donut chart |
<BigValue> | Single KPI number with optional comparison |
<DataTable> | Sortable, paginated data table |
<BonnardChart> | Universal renderer — pass a spec object |
For rendering markdown dashboards in React apps, use the dashboard sub-entry:
import { DashboardViewer } from '@bonnard/react/dashboard';
// Render from markdown content
<DashboardViewer content={markdownString} />
Dashboards are markdown files with YAML query blocks and chart component tags (<BigValue>, <LineChart>, <BarChart>, etc.). See bon docs dashboards for the full format reference.
The dashboard entry adds parser dependencies (gray-matter, remark, rehype). Only import it if you need it — the main entry stays lightweight.
<BonnardProvider config={{ apiKey: '...' }} darkMode={true}>
Options: true, false, or 'auto' (default — uses prefers-color-scheme).
Override CSS custom properties to match your brand:
:root {
--bon-bg: #fafafa;
--bon-text: #1a1a1a;
--bon-border: #e0e0e0;
--bon-radius: 12px;
}
<BonnardProvider config={{ apiKey: '...' }} palette="observable">
Built-in palettes: default, tableau, observable, metabase. Or pass a custom array of hex colors.
<BonnardProvider>| Prop | Type | Default | Description |
|---|---|---|---|
config | BonnardConfig | — | SDK config (apiKey or fetchToken) |
darkMode | boolean | 'auto' | 'auto' | Dark mode control |
palette | PaletteName | string[] | 'tableau' | Chart color palette |
chartHeight | number | 320 | Default chart height in px |
useBonnardQuery(options)| Option | Type | Description |
|---|---|---|
query | QueryOptions | Cube query (measures, dimensions, filters, etc.) |
skip | boolean | Skip execution (for conditional queries) |
Returns { data, loading, error, refetch }.
FAQs
Bonnard embedded analytics — React charts, dashboards, and hooks
We found that @bonnard/react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.