API Reference

Complete reference for all Hollows UI exports, CLI commands, and configuration options.

Hollow Component

The primary component for wrapping data-dependent UI sections. Available from each framework adapter.

tsx
import { Hollow } from 'hollows-ui/react'// import { Hollow } from 'hollows-ui/vue'// import { Hollow } from 'hollows-ui/svelte'// import { Hollow } from 'hollows-ui/angular'

Props

PropTypeDefaultDescription
namestringrequiredUnique identifier that maps to the registry entry
emptybooleanfalseWhether to show the empty state
loadingbooleanfalseShow a skeleton placeholder while loading
themestring | ThemeinheritedOverride the theme for this instance
illustrationstringautoOverride the illustration by name
headingstringautoOverride the heading text
bodystringautoOverride the body text
ctaLabelstringautoOverride the CTA button label
onCtaClick() => void--Callback when the CTA button is clicked
ctaHrefstring--Render CTA as a link instead of a button
classNamestring--Additional CSS class for the container
childrenReactNode--Content to render when not empty

HollowsProvider

Optional context provider for setting global configuration at runtime.

tsx
import { HollowsProvider } from 'hollows-ui/react'<HollowsProvider theme="playful" locale="en">  <App /></HollowsProvider>

Props

PropTypeDefaultDescription
themestring | Theme'minimal'Global theme for all Hollow components
localestring'en'Active locale for copy resolution
registryRegistryautoOverride the registry at runtime

CLI Commands

hollows-ui build

Scan your codebase, classify components, and generate empty states.

FlagDefaultDescription
--watchfalseWatch for file changes and rebuild
--forcefalseIgnore cache and rebuild everything
--config <path>autoPath to config file
--outDir <dir>src/hollowsOutput directory for generated files
--name <name>allGenerate for a specific component only
--dry-runfalsePreview what would be generated without writing files
--verbosefalseShow detailed output including file paths

hollows-ui init

Initialize a new Hollows UI configuration file.

FlagDescription
--framework <name>Set framework (react, vue, svelte, angular)
--theme <name>Set initial theme (minimal, playful, corporate)

hollows-ui analyze

Analyze and report on the bundle size impact of generated empty states.

hollows-ui preview

Launch a local preview server showing all generated empty states side by side.

hollows-ui list

List all detected Hollow components with file locations and classifications.

hollows-ui export-illustrations

Export built-in SVG illustrations as standalone files.

FlagDefaultDescription
--out <dir>./public/empty-statesOutput directory for SVG files

Config Options

The hollows.config.ts file accepts the following top-level options via defineConfig().

hollows.config.ts
ts
import { defineConfig } from 'hollows-ui'export default defineConfig({  // Framework detection (auto-detected if not set)  framework: 'react', // 'react' | 'vue' | 'svelte' | 'angular'  // Glob patterns to scan for Hollow usage  include: ['src/**/*.{tsx,jsx,vue,svelte}'],  exclude: ['**/*.test.*', '**/*.stories.*'],  // Output directory for generated files  outDir: 'src/hollows',  // Theme configuration  theme: 'minimal', // string | Theme object  // Copy configuration  copy: {    tone: 'friendly',    defaultLocale: 'en',    locales: {},    templates: {},  },  // Responsive configuration  responsive: {    strategy: 'viewport',    breakpoints: { sm: '640px', md: '768px', lg: '1024px', xl: '1280px' },  },  // Performance options  performance: {    lazyIllustrations: false,  },  // Custom illustrations  illustrations: {    custom: [],  },})
FieldTypeDefaultDescription
frameworkstringautoTarget framework
includestring[]autoGlob patterns to scan
excludestring[][]Glob patterns to ignore
outDirstringsrc/hollowsOutput directory
themestring | ThememinimalDefault theme
copyCopyConfig{}Copy/language configuration
responsiveResponsiveConfig{}Responsive behavior config
performancePerformanceConfig{}Performance options
illustrationsIllustrationConfig{}Custom illustration config

Theme API

createTheme(options)

Creates a custom theme object. All properties are optional and fall back to the minimal theme defaults.

ts
import { createTheme } from 'hollows-ui'const theme = createTheme({  name: string,  colors: {    background: string,    foreground: string,    muted: string,    accent: string,    border: string,  },  typography: {    headingFont: string,    bodyFont: string,    headingWeight: number,    headingSize: string,    bodySize: string,  },  spacing: {    containerPadding: string,    illustrationGap: string,    ctaGap: string,  },  borders: {    radius: string,    width: string,    style: string,  },  illustrations: {    maxWidth: number,    style: 'outline' | 'filled' | 'duotone',    strokeWidth: number,  },  cta: {    borderRadius: string,    padding: string,    fontSize: string,    fontWeight: number,  },})

extendTheme(base, overrides)

Extend a built-in theme with partial overrides.

ts
import { extendTheme } from 'hollows-ui'const theme = extendTheme('playful', {  colors: { accent: '#6366f1' },  borders: { radius: '1rem' },})

getTheme(name)

Retrieve a built-in or registered theme by name. Returns the minimal theme if the name is not found.

ts
import { getTheme } from 'hollows-ui'const theme = getTheme('playful')// Returns: { name: 'playful', colors: {...}, ... }

Copy API

defineCopyTemplate(category, template)

Define a reusable copy template for a component category.

ts
import { defineCopyTemplate } from 'hollows-ui'defineCopyTemplate('inbox', {  heading: 'No {{itemType}} yet',  body: 'New {{itemType}} will appear here.',  cta: 'Create {{itemType}}',})

generateCopy(classification, tone?, hints?)

Generate copy programmatically for a given classification.

ts
import { generateCopy } from 'hollows-ui'const copy = generateCopy('inbox', 'friendly', { itemType: 'messages' })// Returns: { heading: '...', body: '...', cta: '...' }

Template variables

VariableDescription
{{name}}The component name (from the Hollow name prop)
{{itemType}}Inferred item type (e.g., "messages", "users")
{{category}}The classified category (inbox, table, search, etc.)
{{query}}Search query (only for search-type components)

Illustration API

registerIllustration(name, options)

Register a custom illustration for use in Hollow components.

OptionTypeDescription
svgstringSVG markup string (required)
variantsRecord<string, string>Theme-specific SVG variants
viewBoxstringOverride the SVG viewBox (default: "0 0 64 64")

getIllustration(name)

Retrieve a registered illustration by name. Returns the SVG string.

ts
import { getIllustration } from 'hollows-ui'const svg = getIllustration('empty-inbox')// Returns: '<svg viewBox="0 0 64 64" ...>...</svg>'

getIllustrationForClassification(classification)

Get the illustration name that best matches a component classification.

ts
import { getIllustrationForClassification } from 'hollows-ui'const name = getIllustrationForClassification('inbox')// Returns: 'empty-inbox'

Built-in illustration names

empty-inboxno-resultsempty-cartno-notificationsempty-tableno-usersempty-folderno-messagesempty-favoritesno-activityno-dataempty-calendarerror-state

Utility Types

TypeScript types exported for use in your application.

ts
import type {  HollowProps,  HollowsConfig,  Theme,  ThemeColors,  ThemeTypography,  ThemeSpacing,  ThemeBorders,  CopyTemplate,  CopyTone,  IllustrationStyle,  RegistryEntry,  Registry,  ResponsiveConfig,  BreakpointConfig,  HollowDescriptor,  ComponentClassification,  ScannedComponent,  AnalyzedComponent,  IllustrationMeta,} from 'hollows-ui'
TypeDescription
HollowPropsProps accepted by the Hollow component
HollowsConfigShape of the hollows.config.ts default export
ThemeFull theme object (return type of createTheme)
CopyTone'friendly' | 'professional' | 'playful' | 'minimal'
IllustrationStyle'outline' | 'filled' | 'duotone'
RegistryEntryA single entry in the generated registry
RegistryRecord<string, RegistryEntry>
HollowDescriptorFull descriptor including illustration, copy, and theme
ComponentClassificationClassification result from the CLI scanner
ScannedComponentRaw component data from the scanner
AnalyzedComponentComponent with classification and generated output
IllustrationMetaMetadata for a registered illustration