<lbj-mini-catalog> is a Stencil web component I built for Urban Institute's Lyndon design system. Point it at a CSV and it
renders a catalog you can search, filter and page through. To publish a new library, directory or data catalog, an editor only had to upload
a new CSV; nobody touched code.
Each preset is the same component with a different CSV and different attributes.
All records, people and bios are fictional sample data made for this demo.
This is everything the page needs. In Drupal, a block form wrote these attributes.
Edit the preset's CSV below or load one of your own, then render it with the current preset's settings. The first row is the header; use
; to put several values in one cell. Everything stays in your browser.
drupalSettings and read by the component through toggle_csv_local.
Here, the “Bring your own CSV” panel adds one step before the component. A visitor's CSV is parsed, its headers are normalized and every
cell is sanitized. It is then handed to the component as a blob: URL, so the original fetch-and-parse pipeline still does the
rendering.
The component: lbj-mini-catalog.tsx (sample CSVs and demo code are in the same repository). Also see the search results component and more Drupal work at drupal.joshnliz.com.
Lyndon is MIT licensed. Urban's licensed web fonts are not included, so Lato and Jost stand in.