Installation

EVA components are distributed as standard Web Components and can be used in any modern web application.

Option 1: npm (Recommended)

bash npm install @eva-sovereign/web-components

Option 2: CDN

html <script type="module" src="https://unpkg.com/@eva-sovereign/web-components"></script>
โ„น๏ธ
Browser Support: EVA components work in all modern browsers (Chrome 67+, Firefox 63+, Safari 13.1+, Edge 79+).

Quick Start

Follow these steps to create your first EVA-powered application:

  1. Import the components
    javascript import '@eva-sovereign/web-components';
  2. Use components in your HTML
    html <eva-button variant="primary">Click Me</eva-button> <eva-input type="email" placeholder="Enter your email"></eva-input>
  3. Handle events with JavaScript
    javascript const button = document.querySelector('eva-button'); button.addEventListener('eva-click', () => { console.log('Button clicked!'); });
๐ŸŽฎ Try It Live
Submit
โœ…
That's it! You now have a working EVA component in your application. Continue reading to learn more advanced patterns.

Available Components

EVA provides 11 production-ready components, all WCAG AAA compliant and GC Design System certified.

๐Ÿ”˜
eva-button

6 variants: supertask, primary, secondary, danger, link, contextual-signin

๐Ÿ“
eva-input

Text, email, password, tel, url, number with validation

๐Ÿ“‹
eva-select

Dropdown with keyboard navigation and error states

โ˜‘๏ธ
eva-checkbox

Custom styled with 44px touch targets

๐Ÿ”˜
eva-radio

Mutual exclusion with arrow navigation

๐Ÿ—‚๏ธ
eva-tabs

Tabbed interface with Home/End shortcuts

๐ŸชŸ
eva-modal

3 sizes with focus trap and Esc close

๐Ÿƒ
eva-card

Default, bordered, elevated variants

โš ๏ธ
eva-alert

Success, info, warning, danger (dismissible)

๐Ÿ’ฌ
eva-chat-panel

Message bubbles, typing indicator, RAG-ready

๐Ÿ“š
Full Documentation: Visit the Storybook for interactive examples and the API Docs for detailed property/event references.

React Integration

EVA components work seamlessly with React. Use refs and addEventListener for event handling:

jsx import { useRef, useEffect, useState } from 'react'; import '@eva-sovereign/web-components'; function LoginForm() { const buttonRef = useRef(null); const inputRef = useRef(null); const [email, setEmail] = useState(''); useEffect(() => { const button = buttonRef.current; const input = inputRef.current; const handleClick = () => { console.log('Email:', email); }; const handleInput = (e) => { setEmail(e.detail.value); }; button.addEventListener('eva-click', handleClick); input.addEventListener('eva-input', handleInput); return () => { button.removeEventListener('eva-click', handleClick); input.removeEventListener('eva-input', handleInput); }; }, [email]); return ( <div> <eva-input ref={inputRef} type="email" placeholder="Email"></eva-input> <eva-button ref={buttonRef} variant="primary">Sign In</eva-button> </div> ); }
โš ๏ธ
Important: Use refs + addEventListener, not JSX props. Web Components don't support React synthetic events.

Vue Integration

Configure Vue to recognize EVA components as custom elements:

vite.config.ts

typescript import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; export default defineConfig({ plugins: [ vue({ template: { compilerOptions: { isCustomElement: (tag) => tag.startsWith('eva-') } } }) ] });

Component Usage

vue <script setup lang="ts"> import { ref, onMounted } from 'vue'; import '@eva-sovereign/web-components'; const email = ref(''); const buttonRef = ref(null); onMounted(() => { buttonRef.value?.addEventListener('eva-click', () => { console.log('Email:', email.value); }); }); </script> <template> <eva-input v-model="email" type="email" placeholder="Email" /> <eva-button ref="buttonRef" variant="primary">Sign In</eva-button> </template>

Vanilla JavaScript

Using EVA components with vanilla JavaScript is straightforward:

html <!DOCTYPE html> <html> <head> <script type="module" src="path/to/eva-components.js"></script> </head> <body> <eva-input id="emailInput" type="email"></eva-input> <eva-button id="submitBtn" variant="primary">Submit</eva-button> <script> const input = document.getElementById('emailInput'); const button = document.getElementById('submitBtn'); button.addEventListener('eva-click', () => { console.log('Email:', input.value); }); </script> </body> </html>

Theming

EVA components use CSS custom properties for theming. Override these variables to customize appearance:

css :root { /* GC Design System Colors */ --eva-color-primary: #26374a; --eva-color-secondary: #2b8a3e; --eva-color-danger: #c92a2a; /* Spacing */ --eva-spacing-sm: 0.5rem; --eva-spacing-md: 1rem; --eva-spacing-lg: 1.5rem; /* Typography */ --eva-font-family: "Noto Sans", Arial, sans-serif; --eva-font-size-base: 1rem; /* Borders */ --eva-border-radius: 4px; --eva-border-width: 1px; }
๐ŸŽจ
GC Compliance: EVA components ship with GC Design System defaults. Customize only if needed for your application.

Internationalization (i18n)

EVA components support EN-CA and FR-CA out of the box. Switch locales globally:

javascript import { setGlobalLocale } from '@eva-sovereign/web-components'; // Switch to French setGlobalLocale('fr-CA'); // Switch back to English setGlobalLocale('en-CA');

Or set locale per component:

html <eva-button locale="fr-CA">Soumettre</eva-button>
๐ŸŒ Locale Switcher
English Franรงais

Accessibility

All EVA components meet WCAG 2.2 AAA standards:

โŒจ๏ธ
Keyboard Navigation

Tab, Enter, Space, Arrow keys, Home/End shortcuts

๐Ÿ‘๏ธ
Screen Readers

ARIA labels, live regions, semantic HTML

๐ŸŽจ
High Contrast

7:1 contrast ratio, visible focus indicators

๐Ÿ“ฑ
Touch Targets

44px minimum size (WCAG AAA)

โ™ฟ
Government Compliance: EVA components are certified for use in Government of Canada applications requiring accessibility compliance.

Resources

๐Ÿ“–
Storybook

Interactive component documentation with 40+ stories

View Storybook โ†’
๐Ÿ“š
API Documentation

Complete API reference generated from TypeScript

View API Docs โ†’
๐Ÿ’ฌ
Canada.ca Chatbot

Production demo with RAG integration

View Demo โ†’
๐ŸŽจ
GC Design Lab

Complete component showcase

View Showcase โ†’