Zubra UI
Code for
GitHub

feature-grid

What a product does, as a grid of short features: an icon or emoji, a title and a line each. As many columns as fit (min wide each). items is [{ title, text, icon? }].

This one has no events: it shows what it's given.

Source: feature-grid.zb, and its registry item.

Install

Compiled (any project)
npx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/feature-grid.jsonpnpm dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/feature-grid.jsonyarn dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/feature-grid.jsonbunx --bun shadcn@latest add https://zubra-js.github.io/zubra-ui/r/feature-grid.json
One file, no dependencies (4.2 KB gzipped)
npx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/feature-grid.jsonpnpm dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/feature-grid.jsonyarn dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/feature-grid.jsonbunx --bun shadcn@latest add https://zubra-js.github.io/zubra-ui/r/element/feature-grid.json
.zb source (to edit it with Zubra)
npx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/feature-grid.jsonpnpm dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/feature-grid.jsonyarn dlx shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/feature-grid.jsonbunx --bun shadcn@latest add https://zubra-js.github.io/zubra-ui/r/src/feature-grid.json
No build: a script tag, straight from this site
HTML
<link rel="stylesheet" href="https://zubra-js.github.io/zubra-ui/themes/default.css">
<script type="module" src="https://zubra-js.github.io/zubra-ui/cdn/feature-grid.js"></script>

The compiled install writes src/components/zubra/feature-grid.js and the theme, and adds @zubra/runtime to your dependencies. The one-file install writes the same path as a plain custom element that needs nothing installed (or download it and load it with a <script type="module">); it's smaller on a page with one to three components, the shared runtime with more.

Usage

index.html
<feature-grid heading="Everything for your bakery"></feature-grid>

<script type="module">
  import './components/zubra/feature-grid.js';

  const element = document.querySelector('feature-grid');
  element.items = [
    {
      icon: '🥖',
      title: 'Recipes that scale',
      text: 'Change the batch size and every amount follows.',
    },
    {
      icon: '⏱',
      title: 'Timers per step',
      text: 'Proofs and bakes run side by side, with alerts.',
    },
    {
      icon: '🧾',
      title: 'Costs per loaf',
      text: 'Ingredient prices turn into a price per item.',
    },
  ];
</script>
Example.jsx
import './components/zubra/feature-grid.js';

const items = [
  {
    icon: '🥖',
    title: 'Recipes that scale',
    text: 'Change the batch size and every amount follows.',
  },
  {
    icon: '⏱',
    title: 'Timers per step',
    text: 'Proofs and bakes run side by side, with alerts.',
  },
  {
    icon: '🧾',
    title: 'Costs per loaf',
    text: 'Ingredient prices turn into a price per item.',
  },
];

export function FeatureGridExample() {
  return (
    <feature-grid heading="Everything for your bakery" items={items}></feature-grid>
  );
}
Example.vue
<script setup>
import './components/zubra/feature-grid.js';
const items = [
  {
    icon: '🥖',
    title: 'Recipes that scale',
    text: 'Change the batch size and every amount follows.',
  },
  {
    icon: '⏱',
    title: 'Timers per step',
    text: 'Proofs and bakes run side by side, with alerts.',
  },
  {
    icon: '🧾',
    title: 'Costs per loaf',
    text: 'Ingredient prices turn into a price per item.',
  },
];
</script>

<template>
  <feature-grid heading="Everything for your bakery" :items.prop="items"></feature-grid>
</template>

<!-- vite.config.js: vue({ template: { compilerOptions: { isCustomElement: (tag) => tag.includes('-') } } }) -->
Example.svelte
<script>
  import './components/zubra/feature-grid.js';
  const items = [
    {
      icon: '🥖',
      title: 'Recipes that scale',
      text: 'Change the batch size and every amount follows.',
    },
    {
      icon: '⏱',
      title: 'Timers per step',
      text: 'Proofs and bakes run side by side, with alerts.',
    },
    {
      icon: '🧾',
      title: 'Costs per loaf',
      text: 'Ingredient prices turn into a price per item.',
    },
  ];
</script>

<feature-grid heading="Everything for your bakery" {items}></feature-grid>
example.component.ts
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import './components/zubra/feature-grid.js';

@Component({
  selector: 'app-feature-grid-example',
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
  template: `
    <feature-grid heading="Everything for your bakery" [items]="items"></feature-grid>
  `,
})
export class FeatureGridExample {
  items = [
    {
      icon: '🥖',
      title: 'Recipes that scale',
      text: 'Change the batch size and every amount follows.',
    },
    {
      icon: '⏱',
      title: 'Timers per step',
      text: 'Proofs and bakes run side by side, with alerts.',
    },
    {
      icon: '🧾',
      title: 'Costs per loaf',
      text: 'Ingredient prices turn into a price per item.',
    },
  ];
}

API

Properties (each is also an HTML attribute of the same name, unless marked)
PropertyTypeDefault
items
property only
{ icon, title, text }[][]
headingstring""
minstring"15rem"
Slots
SlotFor
headingA heading above the grid (defaults to heading, shown only when set).

Size

0.9 KB gzipped for the component, plus the runtime, which every Zubra component on a page shares (up to 22.1 KB, all of it). On its own, with the parts of the runtime it uses, it's 17.1 KB.

Theme

Every component reads shadcn/ui's CSS variables, so any shadcn theme works. Pick a look or a colour, or paste a theme's CSS.

Look: colours, fonts, corners and motion

Accent colour