@takuhii/bricks-nuxt
v1.3.0
Published
Nuxt 3 module for zero-config Bricks integration — SSR-safe component registration, CSS injection, and theme support
Readme
@takuhii/bricks-nuxt
Nuxt 3 module for zero-config integration of the Bricks design system.
Installation
pnpm add @takuhii/bricks-nuxt @takuhii/bricks-coreUsage
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@takuhii/bricks-nuxt'],
bricks: {
theme: 'default',
},
});That's it. All W* components are available globally in templates without imports.
What it does
- Registers all Bricks components globally — SSR-safe, no CSS-in-JS issues
- Injects stylesheets — reset, styleguide, and theme CSS in the correct order
- Provides theme CSS variables —
:rootvariables for the selected brand - Transpiles @takuhii/bricks-core — ensures Vite processes it correctly
- Auto-imports composables —
usePrice,useCarousel,useCloudinaryConfig,provideCloudinaryConfig - Adds component types — template intellisense for all
W*components
Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| theme | 'default' | 'default' | Brand theme to apply |
| globalComponents | boolean | true | Register all components globally |
| composables | boolean | true | Auto-import composables |
Adding new components
When a new component is added to @takuhii/bricks-core, regenerate the plugin:
# Ensure core is built first
pnpm --filter @takuhii/bricks-core run build
# Regenerate the plugin and type declarations
node packages/nuxt/scripts/generate-plugin.mjsDevelopment
# Build the module
pnpm --filter @takuhii/bricks-nuxt run build