Shadwire

Search the documentation

Search the documentation and component pages by title and by content.

Get started
Introduction
Installation
shadwire.json
Theming
Dark mode
Tools
CLI
Agent skill
Registry
llms.txt
Guides
Composition
Styling
Forms
Icons
Accessibility
Localisation
Blocks
Overview
Components
Overview
Accordion
Alert
Alert Dialog
Aspect Ratio
Avatar
Badge
Breadcrumb
Button
Button Group
Calendar
Card
Carousel
Chart
Checkbox
Collapsible
Combobox
Command
Context Menu
Data Table
Date Picker
Dialog
Drawer
Dropdown Menu
Empty
Field
Hover Card
Icon
Input
Input Group
Input OTP
Item
Kbd
Label
Menubar
Native Select
Navigation Menu
Pagination
Popover
Progress
Radio Group
Resizable
Scroll Area
Select
Separator
Sheet
Sidebar
Skeleton
Slider
Sonner
Spinner
Switch
Table
Tabs
Textarea
Toggle
Toggle Group
Tooltip

Registry

The CLI installs components from a set of static JSON files. There is no application server and no login.

Shadwire's registry is published at shadwire.edumoraes.dev.br/r. It has an index with the catalog, and one file per item that contains the full source of each of the item's files.

URL Contents
/r/index.json The catalog (name, title, description, when to use) and base: the shared files and gems that init installs.
/r/{name}.json One component: its metadata, the other items it depends on, its API, and its files with their contents.
/r/llms.txt The same catalog in plain text, for agents.
/r/llms-full.txt Every component's full API in plain text.
curl -s https://shadwire.edumoraes.dev.br/r/index.json | jq '.items | length'
curl -s https://shadwire.edumoraes.dev.br/r/button.json | jq '.api.components[0].variants'

index.json

list and search read this file, and init gets the base files from it.

{
  "name": "shadwire",
  "version": "0.2.0",
  "items": [
    {
      "name": "button",
      "type": "component",
      "title": "Button",

One item

Each item has everything needed to install it in a single request, file contents included. registryDependencies already includes the dependencies of dependencies, so the CLI does not have to look them up one by one.

{
  "name": "button",
  "type": "component",
  "title": "Button",
  "description": "Displays a button or a link styled as a button.",
  "whenToUse": "Any clickable action…",
  "usage": ["<%= ui_button(variant: :outline, size: :sm) { \"Save\" } %>"],
  "gems": [],
Field What it is
whenToUse A sentence on when to use this component and which similar ones to consider. Search matches against this text.
usage ERB snippets for the most common uses.
registryDependencies The other items that get installed with it, including indirect dependencies.
requiresStimulus True when the item installs a controller under app/javascript/.
api.components[] Read from the source code: class, helper, variants, sizes, arguments and attributes.
files[] Each file as { target, type, content }. Paths inside the Shadwire repository are left out.

How it is built

It starts from registry/registry.json in the Shadwire repository, which lists each item's files as source → target pairs. bin/build_registry turns that into the published registry: it copies in each file's contents and reads the API from the source:

bin/build_registry            # registry/registry.json → build/r/{name}.json + index.json
ls build/r | head

The output goes to build/, which is generated and should not be edited by hand. CI rebuilds it on every push to main, when it deploys this site.

Serving your own

These are static files, so you can host them anywhere: a storage bucket, GitHub Pages, a directory behind a web server. Point the CLI at it with --registry, or pass the flag to init to save it in shadwire.json.

file:// URLs work too, which is handy for testing a registry you built locally:

bin/build_registry
bin/shadwire add button --registry "file://$PWD/build/r"