UI kits
EmVB 1.5 comes with five official UI kit extensions. Each one adds a few elements to the Add panel that use a well-known CSS framework’s own class names and markup, so a site can mix EmVB’s built-in elements with Bulma cards, Carbon tiles or UIkit accordions on the same page. Each kit is its own package and is registered on its own.
1.5 ships a starter set of core elements for each kit. More of each kit’s components will follow.
| Kit | Package | Elements |
|---|---|---|
| Bulma 1.0.4 | @perkyzz/emvb-kit-bulma |
Card (with a Body slot for your own elements), Button, Tag, Notification, Box, Hero, Message, Columns (each Column holds your own elements), Media Object, Level, Breadcrumb, Pagination, Progress, Table |
Carbon (@carbon/styles 1.120.0) |
@perkyzz/emvb-kit-carbon |
Link Button, Tag, Tile (holds your own elements), Inline Notification, Accordion with Accordion Panels (each holds your own elements), Breadcrumb, Link, Progress Bar, Structured List, Data Table, Code Snippet |
| UIkit 3.25.31 | @perkyzz/emvb-kit-uikit |
Badge, Label, Button, Card (with a body slot), Alert (optionally closable), Accordion with Accordion Items, Grid, Section and Article (each holds your own elements), Overlay (text over your Image), Subnav, Breadcrumb, Switcher with Switcher Panes (each holds your own elements), Slider (your own elements as slides), Modal (a button that opens a dialog with your own elements); text on the page turns light on a dark page |
| Pure.css 3.1.0 | @perkyzz/emvb-kit-pure |
Link Button (Primary, Active, Disabled look; five sizes), Table, Horizontal, Vertical and Dropdown Menus, Grid with responsive Grid Units, Image Grid |
Spectrum CSS (@spectrum-css/* with tokens 16.0) |
@perkyzz/emvb-kit-spectrum |
Button, Action Button, Link, Badge, Tag, Status Light, Avatar, Heading (pick its level), Body, Detail, Divider, Well and Card (both hold your own elements), Breadcrumbs, Progress Bar |
The kits are on npm, listed in the Extension Registry, versioned
with EmVB (kit 1.6.x works with EmVB 1.6 and later 1.x). Their source is in the repository’s
examples/ folder. Each has a README with its elements, settings and the command
that rebuilds its stylesheet.
Up to 1.5 the kits were not published, and the demos imported them as emvb-ext-bulma and so on.
Only the package name changed: the elements keep their stored type (ext:emvb-ext-bulma/card), so
pages built with a 1.5 kit open and render unchanged with the npm package.
Register a kit
Install the kits you want next to EmVB:
npm i @perkyzz/emvb-kit-bulma @perkyzz/emvb-kit-uikit
Then add them to emvb({ extensions }) in astro.config.mjs:
import { emvb } from "@perkyzz/emvb";
import bulma from "@perkyzz/emvb-kit-bulma";
import uikit from "@perkyzz/emvb-kit-uikit";
emvb({ extensions: [bulma, uikit] });
Restart the dev server. The kit’s elements appear in the Add panel under Content or Layout, with the kit’s name in front (Bulma Card, UIkit Accordion).
What a kit adds to your pages
- Only where it’s used. A kit’s stylesheet is written only on pages that show one of its elements, and only once per page. A page with no kit elements is unchanged.
- Scoped styles. Each kit’s CSS is scoped to its own elements, so it does not restyle your headings, links or the rest of the page. The kits leave out their frameworks’ global reset.
- No script, except UIkit. Bulma, Carbon, Pure and Spectrum are CSS only. UIkit adds its own unchanged script (about 130 KB) on pages that have a UIkit element, which is what runs its Accordion, Switcher, Slider, Modal and closable Alert. Under reduced motion they change without animating.
- Your own content inside. Containers (Bulma Card, Carbon Tile, UIkit Card, UIkit Accordion, Pure Grid) have a slot: drop your own EmVB elements into them as into a Box. Some slots take only their own parts: a UIkit Accordion holds Accordion Items, and a Pure Grid holds Grid Units.
- Accessible defaults. Buttons are real links with a visible keyboard focus ring, headings let you pick their level, tables use header cells, notifications have the right role for screen readers, and each kit’s elements pass an automated accessibility check on a built site.
Colours and fonts
The kits keep their frameworks’ own colours, fonts and radius. They don’t follow Site styles yet, because each framework stores its theme differently. Where a kit’s colours didn’t meet text contrast guidelines, the kit uses a darker shade.
The Bulma, Carbon, Pure and Spectrum kits follow dark mode the way Site styles colours do: their dark colours apply when the visitor’s system prefers dark and no Theme toggle chose light, or when a Theme toggle chose dark. Some elements (links, breadcrumbs, menus) have no background of their own, so give a dark page a dark background, for example with a Site styles colour named Background. Each kit’s README says which colours change.
Write your own kit
The kits are ordinary extensions. To build one for another framework, see Extensions and the Extensions API reference. The five kits are good starting points: each has a build script that compiles only the components it uses.