Silvi

A visual the kit does not have, drawn by a component written in the report's own report.tsx.

<k.Custom> draws a component you write yourself, in the report’s report.tsx, with the report’s data. Use it for a visual only this report needs and no component can draw, such as two dots per region for last year and this year.

Reach for it last. First ask whether a component’s props can do it: most requests are a Line, a Table or Kpis with the right props. Do not use it:

  • for a chart a component already draws. A component brings the “(i)”, the loading state, the empty state, the number formats and the theme; your component brings only what you write.
  • for text. Explanations go in the report’s “(i)” dialog, never on the page.
  • to reshape rows. Do that in the SQL, or with reconstruct (see Report files), and give a component the result.
  • for a visual many reports need. Ask Claude for a new component in the kit instead, so every report can use it and it gets a page here.

The component lives in report.tsx itself: a report folder holds only its report.tsx and .sql files, so it cannot be a file of its own.

Example

Sales, last year to this year

North104 → 120
South112 → 95
East150 → 180
West131 → 140

The component receives data, every query’s rows by its name, and filters, the dates and inputs in force (from, to, params). Draw it with the theme’s colours (bg-primary, text-muted-foreground) and the kit’s fmt for numbers, so it matches the components around it.

Props

Only key and span of Props every component takes: title, description, info and metric are the component’s to draw.

Name Type Required Default Meaning
component a component of { data, filters } yes What to draw. data holds each query’s rows by its name; filters the dates and inputs in force
span 1 or 2 no 2 1 takes half the row, 2 the whole row
skeleton a React element no a chart-sized grey box What shows while the data loads

Checks

A component whose data names a query the report does not have, or a column its rows do not have, fails the typecheck. What the component draws is not checked: open the report after each change.