A production-ready Vue 3 boilerplate/starter template with Modus 2 Web Components integration, featuring TypeScript support, comprehensive component examples, and modern development practices. Perfect for quickly bootstrapping new applications with the Modus Design System.
This boilerplate comes with comprehensive development rules and standards to ensure code quality and consistency:
- π¨ Color Usage - Enforces the 9 approved Modus colors and prevents hardcoded values
 - π§© Modus Web Components - Guidelines for proper component implementation with MCP documentation
 - β‘ Vue Component Creation - Best practices for Vue 3 component architecture and CSS patterns
 
- π Modus Icons - Complete icon system with 500+ validated icon names
 - π Chrome DevTools Testing - Browser debugging integration via MCP for implementation testing
 
Location: All rules are stored in
.cursor/rules/and automatically guide your development workflow through AI assistants.
This boilerplate comes pre-configured with powerful AI development tools to supercharge your workflow:
- π§ Context7 - Advanced context management for AI assistants
 - π Chrome DevTools - Browser debugging integration via MCP
 - π Modus Documentation - Direct access to complete Modus Web Components documentation through AI
 
- π Cursor Rules - Pre-configured development patterns and best practices
 - π― Code Quality - Automated linting, formatting, and type checking
 - π AI-Optimized Workflow - Seamless integration with modern AI coding assistants
 
Note: The
.cursor/directory contains MCP server configurations and development rules that enhance your AI-assisted development experience. These tools provide instant access to Modus documentation and maintain code quality standards automatically.
This boilerplate provides a complete foundation for building Vue.js applications with Modus Web Components:
- β Vue 3 + TypeScript - Modern framework with full type safety
 - β Modus 2 Web Components - Complete integration with the latest Modus design system
 - β Standard Icon Usage - Official Modus icon implementation with CDN delivery
 - β Theme Switching - Support for all Modus themes (Classic/Modern, Light/Dark)
 - β Component Examples - Comprehensive demos of buttons, icons, alerts, and more
 - β Interactive Demos - Live component builder and event handling examples
 - β Accessibility - WCAG 2.1 AA compliant with proper ARIA support
 - β Performance Optimized - Code splitting, lazy loading, and optimized builds
 - β Development Tools - ESLint, Prettier, and hot module replacement configured
 - β Production Ready - Optimized build configuration and deployment setup
 
If you're working with Figma designs and want AI-assisted coding that understands your design tokens and components, check out the official Modus Figma MCP integration. This powerful tool bridges the gap between design and development by providing direct access to your Figma designs through AI assistants.
Learn more: Modus Figma MCP Integration Guide
Perfect for: Design-to-code workflows, maintaining design system consistency, and accelerating development with AI-powered Figma integration.
- Node.js 20+ (required for Vite 7.x compatibility)
 - npm or yarn
 
- 
Clone or use this template:
# Clone the repository git clone <your-repo-url> my-modus-app cd my-modus-app # Or use as a template on GitHub # Click "Use this template" button
 - 
Install dependencies:
npm install
 - 
Start the development server:
npm run dev
 - 
Open your browser: Navigate to your localhost usually it is http://localhost:3000
 
npm run build
npm run previewThis boilerplate follows Vue.js best practices with a clean, scalable architecture:
modus-vue-app/
βββ src/
β   βββ components/          # Reusable Vue components
β   β   βββ ModusIcon.vue   # Icon wrapper component
β   βββ views/              # Page components
β   β   βββ Home.vue        # Landing page with examples
β   β   βββ ButtonDemo.vue  # Comprehensive component demos  (can be removed)
β   βββ router/             # Vue Router configuration
β   βββ types/              # TypeScript definitions
β   β   βββ modus.d.ts      # Modus component types
β   βββ utils/              # Utility functions
β   β   βββ icons.ts        # Icon validation and helpers
β   βββ main.ts             # Application entry point
βββ public/                 # Public assets
βββ implementation_guides/  # Where your documentation will be stored
βββ .gitignore             # Git ignore configuration
- 
Update project information:
- Modify 
package.jsonwith your project details - Update the app title in 
index.html - Replace demo content in 
Home.vuewith your application content - You can delete 
ButtonDemo.vueif you don't need it 
 - Modify 
 - 
Add your components:
- Create new components in 
src/components/ - Add new pages in 
src/views/ - Update routing in 
src/router/index.ts 
 - Create new components in 
 - 
Configure your build:
- Modify 
vite.config.tsfor your deployment needs - Update environment variables as needed
 - Configure additional build optimizations
 
 - Modify 
 
The boilerplate includes comprehensive examples of:
- Buttons - All variants, colors, sizes, and shapes with interactive builder
 - Icons - Complete icon system with standard Modus implementation
 - Alerts - Success, warning, error, and info messages
 - Theme Switching - Dynamic theme changes with persistence
 - Form Integration - Proper form handling with Modus components
 - Event Handling - Complete event management examples
 
<template>
  <!-- Direct web component usage -->
  <modus-wc-button color="primary" @click="handleClick">
    <i class="modus-icons" style="margin-right: 8px">save_disk</i>
    Save Changes
  </modus-wc-button>
  <!-- Using the ModusIcon wrapper -->
  <ModusIcon
    name="settings"
    size="lg"
    :decorative="false"
    aria-label="Settings"
  />
</template>
<script setup lang="ts">
import ModusIcon from "@/components/ModusIcon.vue";
const handleClick = () => {
  console.log("Button clicked!");
};
</script>This boilerplate includes comprehensive examples of:
- Buttons - All variants, colors, sizes, and shapes
 - Icons - Complete icon system with standard Modus implementation
 - Alerts - Success, warning, error, and info messages
 - Theme Switching - Dynamic theme changes
 
Icons are loaded from the Modus CDN and use the standard <i class="modus-icons">icon_name</i> pattern:
import "@trimble-oss/modus-icons/dist/field-systems/fonts/modus-icons.css";<template>
  <!-- Basic icon usage -->
  <i class="modus-icons">settings</i>
  <!-- Icon with styling -->
  <i class="modus-icons icon-lg icon-primary">{{ iconName }}</i>
  <!-- Using the ModusIcon wrapper -->
  <ModusIcon
    name="settings"
    size="lg"
    :decorative="false"
    aria-label="Settings"
  />
</template>
<script setup lang="ts">
import ModusIcon from "@/components/ModusIcon.vue";
import type { ModusIconName } from "@/types/modus";
const iconName: ModusIconName = "settings";
</script>The application now includes the complete list of all official Modus icons with full TypeScript support:
- Actions: add, edit_combination, delete, save_disk, download, upload, copy_content, refresh, sync
 - Navigation: arrow_left, arrow_right, arrow_up, arrow_down, chevron_left, chevron_right, home, dashboard, menu, close
 - Interface: search, filter, settings, launch, more_horizontal, more_vertical, sort, view_grid, view_list
 - Status: check, check_circle, warning, info, alert, help, cancel_circle
 - Content: file, folder_open, folder_closed, document, image, video, camera
 - User: person, people_group, user_account, sign_in, sign_out, lock, lock_open
 - Communication: email, phone, chat, comment, notifications
 - UI: palette, brightness, visibility_on, visibility_off, toggle_on, toggle_off
 
Total Icons Available: 500+ official Modus icons with complete TypeScript definitions
modus-classic-light(default)modus-classic-darkmodus-modern-lightmodus-modern-dark
// Programmatic theme switching
const changeTheme = (theme: string) => {
  document.documentElement.setAttribute("data-theme", theme);
  localStorage.setItem("modus-theme", theme);
};Full TypeScript support with:
- Component Props - Type-safe Modus component properties
 - Event Handlers - Proper CustomEvent typing
 - Icon Names - Validated icon name types
 - Theme Values - Type-safe theme switching
 
// Type definitions for Modus components
declare global {
  namespace JSX {
    interface IntrinsicElements {
      "modus-wc-button": {
        color?: "primary" | "secondary" | "tertiary" | "warning" | "danger";
        variant?: "filled" | "outlined" | "borderless";
        size?: "xs" | "sm" | "md" | "lg";
        shape?: "rectangle" | "square" | "circle";
        disabled?: boolean;
        "full-width"?: boolean;
        // ... more properties
      };
      "modus-wc-alert": {
        variant?: "success" | "warning" | "error" | "info";
        "alert-title"?: string;
        dismissible?: boolean;
      };
    }
  }
}- Route-based splitting - Each page loads independently
 - Component chunking - Modus components are bundled separately
 - Vendor separation - Vue and utilities in separate chunks
 
- Critical icon preloading - Essential icons load immediately
 - Lazy loading - Non-critical icons load on demand
 - Font display optimization - 
font-display: swapfor better performance 
- Tree shaking - Unused code is eliminated
 - Asset optimization - Images and fonts are optimized
 - Source maps - Available for debugging
 
- Modern browsers - Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
 - Mobile support - iOS Safari 14+, Chrome Mobile 90+
 - Accessibility - Screen readers and assistive technologies
 - High contrast - Windows high contrast mode support
 
# Development server with hot reload
npm run dev
# Type checking
npm run type-check
# Production build
npm run build
# Preview production build
npm run preview
# Check for non-Modus color usage
npm run lint:colorsThis boilerplate includes a pre-commit hook that automatically checks for non-Modus color usage:
- Detects Tailwind colors - Flags usage of 
red-400,blue-500, etc. - Detects hardcoded colors - Catches hex codes like 
#ff0000, RGB values, and Modus hex values - Suggests Modus alternatives - Provides proper Modus CSS custom properties
 - Runs on commit - Automatically validates staged files before commit
 
Example violations caught:
/* β Will be flagged */
.button {
  background-color: red-500; /* Tailwind color */
  color: #f1f1f6; /* Hardcoded Modus hex */
}
.text {
  color: rgb(23, 28, 30); /* RGB equivalent of Modus color */
}
/* β
 Correct Modus usage */
.button {
  background-color: var(--modus-wc-color-error);
  color: var(--modus-wc-color-base-100);
}
.text {
  color: var(--modus-wc-color-base-content);
}Available Modus Color Variables (9 colors total):
Base Colors (5 total):
var(--modus-wc-color-base-page)- Background: #fff (light) / #000 (dark)var(--modus-wc-color-base-100)- Light gray: #f1f1f6 (light) / #252a2e (dark)var(--modus-wc-color-base-200)- Medium gray: #cbcdd6 (light) / #464b52 (dark)var(--modus-wc-color-base-300)- Dark gray: #b7b9c3 (light) / #353a40 (dark)var(--modus-wc-color-base-content)- Text: #171c1e (light) / #cbcdd6 (dark)
Semantic Colors (4 total - same in both themes):
var(--modus-wc-color-info)- Blue: #0063a3var(--modus-wc-color-success)- Green: #1e8a44var(--modus-wc-color-error)- Red: #da212cvar(--modus-wc-color-warning)- Orange: #fbad26
Note: Component props like
primary,secondary,tertiary, anddangermap to these CSS variables internally.
This boilerplate is ready for deployment to various platforms:
npm run build
# Deploy the dist/ folder- Install additional Modus components if needed
 - Add TypeScript definitions in 
src/types/modus.d.ts - Create wrapper components in 
src/components/ - Add examples in the demo pages or remove demo content for production
 
Use Modus CSS custom properties for consistent theming:
.custom-component {
  background-color: var(--modus-wc-color-base-100);
  color: var(--modus-wc-color-base-content);
  border: 1px solid var(--modus-wc-color-base-200);
}
/* Status-specific styling */
.success-message {
  color: var(--modus-wc-color-success);
  border-left: 3px solid var(--modus-wc-color-success);
}
.error-message {
  color: var(--modus-wc-color-error);
  border-left: 3px solid var(--modus-wc-color-error);
}- Check font loading - Ensure Modus icons CSS is imported
 - Verify icon names - Use only valid Modus icon names
 - Check network - CDN may be blocked in some environments
 
- Verify imports - Ensure Modus components are imported
 - Check custom elements - Vite should recognize 
modus-wc-*tags - Browser support - Ensure browser supports web components
 
- HTML attribute - Ensure 
data-themeis set on<html> - CSS loading order - Modus styles should load before custom styles
 - Local storage - Theme preference should persist across sessions
 
When contributing to this boilerplate:
- Follow Vue 3 best practices
 - Maintain TypeScript strict mode
 - Use Modus design tokens
 - Test across all themes
 - Ensure accessibility compliance
 - Update documentation as needed
 
MIT License - see LICENSE file for details.
Ready to build amazing applications with Modus Design System and Vue 3! π
This boilerplate provides everything you need to get started quickly while following best practices and maintaining high code quality.
Made with β€οΈ by Julian Oczkowski
Lead Product Designer bridging UX & Code β’ Building AI-driven tools, design systems, and digital products
π₯ YouTube β’ πΌ LinkedIn β’ π Website
Created for the Trimble community and developers worldwide π


