MNA Foundation Design System

Introduction

Welcome to the MNA Foundation Design System. This system is a comprehensive VanillaJS and SCSS library designed to be a flexible and token-based foundation for building consistent, high-quality user interfaces with clean architecture principles.

Installation

Install the design system packages from npm. You can install individual packages or all of them:

# Install individual packages
npm install @mna-foundation/tokens
npm install @mna-foundation/core
npm install @mna-foundation/button
npm install @mna-foundation/card
npm install @mna-foundation/container
npm install @mna-foundation/grid
npm install @mna-foundation/accordion
npm install @mna-foundation/tabs
npm install @mna-foundation/rive
npm install @mna-foundation/utils

# Or install all packages at once
npm install @mna-foundation/tokens @mna-foundation/core @mna-foundation/button @mna-foundation/card @mna-foundation/container @mna-foundation/grid @mna-foundation/accordion @mna-foundation/tabs @mna-foundation/rive @mna-foundation/utils

Usage

Import the packages you need in your project:

// SCSS - Import design tokens and components
@use '@mna-foundation/tokens';
@use '@mna-foundation/button';
@use '@mna-foundation/card';
@use '@mna-foundation/rive';

// JavaScript - Import core utilities and components
import { Component, EventEmitter } from '@mna-foundation/core';
import { Accordion } from '@mna-foundation/accordion';
import { Tabs } from '@mna-foundation/tabs';
import { RiveAnimation } from '@mna-foundation/rive';

Figma Resources

Access the complete design system in Figma with components, tokens, and documentation that matches this codebase exactly.

Design System File

Complete design system with all components, tokens, and documentation.

Open in Figma

Community File

Duplicate this file to your Figma workspace and start designing.

Duplicate File

Design System Preview

Preview the design system components directly in this documentation:

MNA Foundation UIKit Open in Figma →

How to Use with Figma

Getting Started as a Designer

  1. Duplicate the File: Click "Duplicate File" above to copy the design system to your workspace
  2. Explore Components: Navigate to the "Components" page to see all available UI elements
  3. Use Design Tokens: Reference the "Tokens" page for colors, typography, and spacing values
  4. Follow Naming Conventions: Use BEM-style naming for layers (e.g., card__title, button--primary)
  5. Create Variants: Use Figma's variant feature to match CSS modifier classes

Recommended Figma Plugins

  • Figma Tokens: Sync design tokens between Figma and code
  • Stark: Check accessibility and color contrast
  • Design System Organizer: Keep components organized
  • Auto Layout: Built-in Figma feature for responsive designs

Developer Workflow

  1. Inspect Designs: Use Figma's inspect panel to see CSS properties
  2. Extract Assets: Export icons and images with proper naming conventions
  3. Verify Implementation: Compare your code output with the Figma designs
  4. Token Validation: Ensure design tokens match between Figma and CSS

Developer Tools

  • Figma API: Programmatically access design data
  • Figma to Code: Generate starter code from designs
  • Design Handoff: Use Figma's built-in developer handoff features
// Example: Extracting design tokens from Figma API
const figmaToken = 'your-figma-token';
const fileKey = 'your-file-key';

fetch(`https://api.figma.com/v1/files/${fileKey}`, {
  headers: { 'X-Figma-Token': figmaToken }
})
.then(response => response.json())
.then(data => {
  // Process design tokens
  console.log(data.document);
});

Design Token Sync

Keep design tokens synchronized between Figma and your codebase:

Token Categories
  • Colors: Primary, secondary, semantic colors
  • Typography: Font families, sizes, weights, line heights
  • Spacing: Padding, margins, gaps (base-4 system)
  • Border Radius: Corner radius values
  • Shadows: Box shadow definitions
Token Format
{
  "colors": {
    "primary": {
      "50": "#eff6ff",
      "500": "#6366f1",
      "600": "#4f46e5"
    }
  },
  "spacing": {
    "4": "1rem",
    "8": "2rem"
  },
  "typography": {
    "font-size-lg": "1.125rem",
    "font-weight-semibold": "600"
  }
}

Quick Actions

View Components Download Assets Export Tokens Report Issue

Designer & Developer Alignment Guide

1. Start with the Design System — Don't Retrofit It

  • Always begin with components and tokens from the system.
  • Don't "apply the system later" — it leads to rework and visual inconsistency.
  • Search for existing components before designing from scratch.
  • Use the provided grid system for all page and section layouts.

2. Component Structure Should Match Code

  • Use BEM naming (e.g. card__title, tabs__list) in Figma layers.
  • Keep nesting clean and semantically meaningful.
  • Avoid arbitrary names like Group 5.

3. Use Variants to Represent Modifiers

  • Create variant properties to match modifier classes: card--shadow, button--primary.
  • Use clear, structured naming in the component properties.

4. Apply Design Tokens Consistently

  • Use token values when styling elements in Figma:
    • Typography: font size, weight, line height from tokens (e.g., --font-size-xl, --font-weight-semibold)
    • Spacing: padding/margin from --spacing-* tokens using a base-4 system (4px, 8px, 16px, etc.)
    • Color: only use variables like --primary-500, not hex codes
  • Reference spacing, color, and typography via tokens: --spacing-4, --font-size-lg.
  • Do not use arbitrary hex codes or pixel values.
  • You can use Figma Tokens plugin or manual references if plugins aren't used.

5. Auto Layout for Components/Layouts

  • Use Auto Layout for all UI components and layout compositions.
  • Always use spacing tokens for padding and gaps — never set arbitrary pixel values (e.g., use --spacing-4 instead of 16px).
  • When composing components into sections, maintain consistent spacing using the token system.
  • Use "Hug contents" or "Fill container" as needed for responsive behavior.
  • Avoid manual spacing adjustments that break the design system's consistency.

6. Layout Composition for Pages or Sections

  • Wrap sections in a container with max-width and padding.
  • Use consistent vertical rhythm with spacing tokens.
  • Use grid system where applicable: grid--cols-1, grid--gap-md.
  • Don't reorder elements visually on mobile — stack naturally to preserve DOM order.

7. Benefits of Using This Design System for Developers

Designer to Developer Workflow Diagram
  • Tokens = predictable code → faster implementation.
  • 1:1 structure between design and DOM structure.
  • Variants map directly to CSS modifiers or props.
  • Theming = token overrides only, not full rewrites.
  • Cleaner Git diffs and fewer design QA bugs.
🎯 Token-to-Code Cheatsheet
--spacing-4   →   padding: var(--spacing-4);   /* 16px */
--font-size-lg   →   font-size: var(--font-size-lg);  /* 18px */
--primary-500    →   color: var(--primary-500);

8. Asset Naming & Icon Sizing — Production-Ready from the Start

  • Name assets clearly: icon/chevron-down/16, not Vector 1 copy.
  • Avoid default Figma names like "Group" or "Rectangle".
  • Emphasize unique, collision-free asset naming.
  • Use kebab-case for asset filenames.
  • Export icons at standard sizes: 16px, 24px, 32px.
  • Use SVG format for crisp and scalable icons.
  • Improper assets lead to delays, bugs, and manual cleanup for devs.

Example:

icon/chevron-down/16.svg
icon/check-filled/24.svg
button/primary-hover.svg
🔤 Naming Conventions
  • Preferred: kebab-case (for consistency with CSS classes)
  • Also acceptable: snake_case, camelCase
  • Better compatibility across OS filesystems and URLs.
  • Industry standard for design token names, web asset files, and icon libraries.
⛔ Avoid:
  • Spaces in filenames: Check Icon.svg ❌ (breaks URLs, causes issues)
  • Uppercase-only: CHEVRON.svg ❌ (case-sensitive issues)
  • Random names: Vector 1 copy.svg ❌ (not descriptive)
  • Default Figma names: Group, Rectangle

9. Use Consistent States and Interactions

  • Always include hover, active, focus, and disabled states for interactive components (e.g. buttons, inputs, tabs).
  • Use variants or separate frames labeled clearly: button / default, button / hover, button / disabled.
  • Avoid leaving behaviors implied — devs need visual confirmation.

10. Validate Accessibility in Design

  • Check color contrast ratios for text, buttons, and backgrounds (use Figma's contrast plugin or tools like Stark).
  • Use minimum font sizes for readability (14px for body text, 18px+ for headings).
  • Ensure clear focus states and tap targets for mobile (48x48px minimum).

11. Organize Components Logically in Figma

  • Follow a naming structure: Component / Category / Variant E.g. Card / Base, Button / Primary / Hover.
  • Use pages in your Figma file for: Tokens, Components, Documentation, Layouts / Pages.

12. Think Modular — Design for Reuse

  • Avoid creating "one-off" designs or pages that break system patterns.
  • Build atomic-to-molecular systems: Badge, Button, Input → Card, Modal, Accordion → Form, Header.
  • Think flexibility: Can this be reused in another layout?

13. Design Optimization Guidelines

  • Typography Optimization: Limit font families and weights — use only what's defined in the design system to reduce load time
  • Text Styles: Avoid unnecessary text styles (e.g. random bold/italic combinations)
  • Image Assets: Compress and optimize image assets before uploading to Figma
  • Compression Tools: Use plugins like TinyPNG or Figma tools like Image Palette Cleaner to reduce asset file sizes
  • Vector Graphics: Use vector shapes or SVGs instead of large raster images whenever possible
  • Opacity Management: Use opacity tokens or tints (lightened color values) instead of setting arbitrary opacities manually
  • Opacity Best Practices: Avoid using 50% opacity on text or backgrounds — instead define and reuse semantically meaningful tints (e.g. --primary-500-tint-50)
  • File Cleanup: Remove hidden layers, unused artboards, and off-canvas content to reduce file bloat
  • Color Consistency: Stick to the defined color palette — avoid introducing undocumented brand colors
  • Component Usage: Use components instead of detached instances to avoid duplication and maintain consistency
  • Responsive Design: Use layout grids and constraints to simulate responsive behavior in design
  • Mobile Testing: Preview mobile breakpoints to ensure spacing, legibility, and interaction patterns hold
  • Regular Audits: Regularly audit your Figma files for unused styles and local overrides

14. Developer Handoffs — Production-Ready Assets

  • Exportable Assets: Ensure all assets are properly set up for export with clear naming conventions
  • Proper Sizing: Define standard sizes (1x, 2x, 3x) for different device densities when needed
  • Batch Export: Use batch export (Shift + Command + E) rather than exporting assets one at a time
  • Export Settings: Configure consistent export settings for each asset type (SVG for icons, PNG/JPG for images)
  • Asset Organization: Group related assets in frames with clear naming for easy batch selection
  • Documentation: Include asset specifications in design handoff notes (dimensions, formats, use cases)
  • Version Control: Use descriptive frame names that indicate asset versions or states
  • Accessibility: Ensure exported assets include proper alt text descriptions for developers
  • File Structure: Organize exports in folders that match the intended file structure for development
  • Quality Assurance: Review exported assets at actual size to ensure they meet quality standards
  • Responsive Assets: Provide multiple sizes for assets that need to scale across different screen sizes
  • Format Guidelines: Use SVG for icons and simple graphics, PNG for images with transparency, JPG for photographs
  • Naming Consistency: Follow the established naming convention (kebab-case) for all exported files
  • Asset Inventory: Maintain a clear list of all exported assets with their intended usage
📋 Pre-Handoff Checklist
  • ✅ All assets are properly named and organized
  • ✅ Export settings are configured for each asset type
  • ✅ Batch export is tested and working
  • ✅ Assets are reviewed at actual size
  • ✅ Documentation includes asset specifications
  • ✅ File structure matches development requirements
  • ✅ No hidden or unused assets are included
  • ✅ All assets follow the design system's naming conventions

Design Tokens

Design tokens are the core of the system, stored as CSS variables. They control all fundamental visual styles to ensure brand consistency.

  • Colors
  • Spacing
  • Typography
  • Border Radius

Primary

--primary-50
--primary-100
--primary-200
--primary-300
--primary-400
--primary-500
--primary-600
--primary-700
--primary-800
--primary-900

Secondary

--secondary-50
--secondary-100
--secondary-200
--secondary-300
--secondary-400
--secondary-500
--secondary-600
--secondary-700
--secondary-800
--secondary-900

Semantic

--success
--warning
--error
--info

Spacing Scale

Spacing tokens follow a base-4 system for consistent spacing across the design system.

--spacing-1 (4px)
--spacing-2 (8px)
--spacing-3 (12px)
--spacing-4 (16px)
--spacing-5 (20px)
--spacing-6 (24px)
--spacing-7 (28px)
--spacing-8 (32px)
--spacing-9 (36px)
--spacing-10 (40px)
--spacing-11 (44px)
--spacing-12 (48px)
--spacing-14 (56px)
--spacing-16 (64px)
--spacing-20 (80px)
--spacing-24 (96px)
--spacing-28 (112px)
--spacing-32 (128px)

Spacing Utility Classes

Use these utility classes for quick spacing adjustments. They follow the same scale as the design tokens.

Naming Convention:
  • p = padding, m = margin
  • t = top, r = right, b = bottom, l = left
  • x = horizontal (left + right), y = vertical (top + bottom)
  • no prefix = all sides (e.g., .p-4 = padding on all sides)
Padding Utilities
.p-2 (8px padding)
.p-4 (16px padding)
.p-6 (24px padding)
Margin Utilities
.m-2 (8px margin)
.mb-4 (16px bottom margin)
.mt-6 (24px top margin)

Usage Examples

Component Spacing
<div class="card p-4 mb-6">
  <h3 class="mb-3">Card Title</h3>
  <p class="mb-4">Card content with proper spacing.</p>
  <button class="mt-4">Action</button>
</div>
Layout Spacing
<div class="container py-8">
  <div class="grid gap-6">
    <div class="col-6 px-4">Left column</div>
    <div class="col-6 px-4">Right column</div>
  </div>
</div>

Font Sizes

Aa --font-size-sm (14px)

Aa --font-size-base (16px)

Aa --font-size-lg (18px)

Aa --font-size-xl (20px)


Headings

H1 Heading 48px / bold

H2 Heading 36px / bold

H3 Heading 30px / semibold

H4 Heading 24px / semibold

H5 Heading 20px / medium
H6 Heading 18px / medium

Border Radius Tokens

Border radius tokens provide consistent corner rounding across the design system.

--radius-none
0px
--radius-1
4px
--radius-2
8px
--radius-3
12px
--radius-4
16px
--radius-full
9999px

Usage Examples

Buttons
Cards
Card 1
Card 2
Card 3

Code Examples

/* Button with small radius */
  .button {
    border-radius: var(--radius-1); /* 4px */
  }

  /* Card with medium radius */
  .card {
    border-radius: var(--radius-2); /* 8px */
  }

  /* Pill-shaped button */
  .button--pill {
    border-radius: var(--radius-full); /* 9999px */
  }

  /* Input field with subtle radius */
  .input {
    border-radius: var(--radius-1); /* 4px */
  }

Theming & Customization

You can easily theme the design system by overriding the CSS variables (tokens) at a global or local scope.

Local Theming Examples

To theme a specific component, create a new CSS class and override tokens within it. Here are several examples:

Dark Theme

Dark Theme Card

This card has a special, locally-scoped dark theme with proper text contrast.

Primary Color Theme

Primary Theme Card

This card uses the primary color palette for a cohesive brand experience.

Success Theme

Success Theme Card

This card uses a success-themed color scheme for positive feedback.

Global Theming

To apply a theme globally, override the CSS variables on the :root selector:

/* Dark mode for entire application */
  :root {
    --background-primary: var(--secondary-900);
    --background-secondary: var(--secondary-800);
    --text-primary: var(--text-inverse);
    --text-secondary: var(--secondary-300);
  }

  /* High contrast mode */
  :root {
    --background-primary: #000000;
    --text-primary: #ffffff;
    --primary-500: #ffff00;
  }

Component-Specific Theming

You can also theme specific components by targeting their CSS classes:

/* Theme all buttons */
  .button {
    --background-primary: var(--primary-600);
    --text-primary: var(--text-inverse);
  }

  /* Theme specific button variants */
  .button--secondary {
    --background-primary: var(--secondary-200);
    --text-primary: var(--secondary-800);
  }

Component Library

Navigation

The Navigation component provides a responsive, accessible, and token-driven navigation bar with optional utility and main navs, dropdowns, and a fixed/sticky option. All spacing, color, and typography use design tokens.

  • Preview
  • Code
<nav class="navigation">
  <div class="navigation__container">
    <div class="navigation__logo">
      <img src="/malogo.svg" alt="Logo" style="height: 40px; margin-right: var(--spacing-3);">
      <div>
        <span style="font-size: var(--font-size-2xl); font-weight: var(--font-weight-bold); color: var(--primary-600);">VYVGART <span style="color: var(--primary-500);">Hytrulo</span></span><br>
        <span style="font-size: var(--font-size-sm); color: var(--text-secondary);">(efgartigimod alfa and hyaluronidase-qvfc)</span>
      </div>
    </div>
    <ul class="navigation__utility">
      <li class="navigation__item"><a href="#" class="navigation__link">Important Safety Information</a></li>
      <li class="navigation__item">
        <button class="navigation__link navigation__link--dropdown" aria-haspopup="true" aria-expanded="false">
          Prescribing Information <span class="navigation__caret"></span>
        </button>
        <ul class="navigation__dropdown">
          <li><a href="#" class="navigation__dropdown-link">PI PDF</a></li>
          <li><a href="#" class="navigation__dropdown-link">Full Label</a></li>
        </ul>
      </li>
      <li class="navigation__item"><a href="#" class="navigation__link">Patient Site</a></li>
      <li class="navigation__item"><a href="#" class="navigation__link">Stay Connected</a></li>
      <li class="navigation__item navigation__item--cta"><a href="#" class="navigation__link navigation__link--outline">Contact a rep</a></li>
    </ul>
    <div class="navigation__main-bar">
      <ul class="navigation__main">
        <li class="navigation__item"><a href="#" class="navigation__link navigation__link--active">Home</a></li>
        <li class="navigation__item">
          <button class="navigation__link navigation__link--dropdown" aria-haspopup="true" aria-expanded="false">
            About <span class="navigation__caret"></span>
          </button>
          <ul class="navigation__dropdown">
            <li><a href="#" class="navigation__dropdown-link">About CIDP</a></li>
            <li><a href="#" class="navigation__dropdown-link">Mechanism of action</a></li>
          </ul>
        </li>
        <li class="navigation__item"><a href="#" class="navigation__link">Clinical data</a></li>
        <li class="navigation__item"><a href="#" class="navigation__link">Safety</a></li>
        <li class="navigation__item"><a href="#" class="navigation__link">Dosing</a></li>
        <li class="navigation__item"><a href="#" class="navigation__link">Access</a></li>
        <li class="navigation__item">
          <button class="navigation__link navigation__link--dropdown" aria-haspopup="true" aria-expanded="false">
            Resources <span class="navigation__caret"></span>
          </button>
          <ul class="navigation__dropdown">
            <li><a href="#" class="navigation__dropdown-link">Brochures</a></li>
            <li><a href="#" class="navigation__dropdown-link">Videos</a></li>
          </ul>
        </li>
        <li class="navigation__item navigation__item--highlighted"><a href="#" class="navigation__link navigation__link--cta"><svg width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" style="margin-right: 6px;"><path d="M12 5v14m7-7H5"/></svg>Enroll patients</a></li>
      </ul>
    </div>
  </div>
</nav>

Note: Both <a> and <button> elements use .navigation__link for consistent height and padding. The navigation uses data-component="Navigation" for design system alignment. Hamburger and close buttons are included for mobile menu toggling.

Container

The Container component provides a consistent wrapper for content with responsive max-width and centered alignment. It ensures content doesn't become too wide on large screens while maintaining proper spacing and readability across all device sizes.

  • Preview
  • Code

This is a container.

<div class="container">...</div>

Grid

The Grid component provides a flexible, responsive layout system based on CSS Grid. It supports multiple columns, gaps, spans, and alignment utilities, making it easy to create complex layouts that adapt to any screen size.

  • Preview
  • Code

Basic 3-Column Grid

Grid

  • Preview
  • Code

Basic 3-Column Grid

1
2
3

12-Column Grid with Spans

Span 6
Span 3
Span 3
Span 4
Span 4
Span 4

Grid with Offsets

Offset 2, Span 4
Offset 8, Span 3

Grid Structure Visualization

1
2
3
4
5
6
7
8
9
10
11
12

Above: 12-column grid structure. Below: Items positioned with offsets.

Responsive Grid (try resizing window)

1
2
3
4
5
6

Grid Alignment Examples

Short
Taller
Medium
<!-- Basic 3-column grid -->
  <div class="grid grid--cols-3 grid--gap-md">
    <div>1</div>
    <div>2</div>
    <div>3</div>
  </div>

  <!-- 12-column grid with spans -->
  <div class="grid grid--cols-12 grid--gap-sm">
    <div class="grid-item grid-item--col-span-6">Span 6</div>
    <div class="grid-item grid-item--col-span-3">Span 3</div>
    <div class="grid-item grid-item--col-span-3">Span 3</div>
  </div>

  <!-- Grid with offsets -->
  <div class="grid grid--cols-12 grid--gap-sm">
    <div class="grid-item grid-item--col-span-4 grid-item--col-start-2">Offset 2, Span 4</div>
    <div class="grid-item grid-item--col-span-3 grid-item--col-start-8">Offset 8, Span 3</div>
  </div>

  <!-- Responsive grid -->
  <div class="grid grid--cols-1 grid--cols-md-3 grid--cols-lg-6 grid--gap-md">
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
    <div>5</div>
    <div>6</div>
  </div>

  <!-- Grid with alignment -->
  <div class="grid grid--cols-3 grid--gap-md grid--items-center">
    <div>Short</div>
    <div>Taller</div>
    <div>Medium</div>
  </div>

Card

The Card component is a flexible content container used to group related information. It follows BEM (Block Element Modifier) conventions and supports various visual styles through modifiers and design tokens.

  • Preview
  • Code

Standard Card

Card with Shadow

This is a standard card with a shadow, header, and body content.

Card with Image

Placeholder image

Card with an Image

This card features a prominent image at the top, perfect for articles or product showcases.

Bordered Card

Bordered Card

This card has a subtle border instead of a shadow.

Horizontal Card

Placeholder image

Horizontal Layout

This card uses a horizontal layout, suitable for item lists or summaries.

<!-- Standard Card -->
  <div class="card card--shadow">
    <div class="card__header"><h4 class="card__title">Card Title</h4></div>
    <div class="card__body">...</div>
    <div class="card__footer"><button class="button">Action</button></div>
  </div>

  <!-- Card with Image -->
  <div class="card card--shadow">
    <img class="card__image" src="..." alt="...">
    <div class="card__body">...</div>
  </div>

  <!-- Bordered Card -->
  <div class="card card--bordered">
    <div class="card__header"><h4 class="card__title">Card Title</h4></div>
    <div class="card__body">...</div>
      </div>

  <!-- Horizontal Card -->
  <div class="card card--shadow card--horizontal">
    <img class="card__image" src="..." alt="...">
    <div class="card__content">...</div>
  </div>

Button

The Button component provides accessible, interactive triggers for user actions. It supports multiple variants, sizes, and states, and is fully customizable using design tokens and modifier classes.

  • Preview
  • Code

Button Variants

Button Sizes

Button States

Button with Icons

<!-- Button Variants -->
  <button class="button">Default</button>
  <button class="button button--primary">Primary</button>
  <button class="button button--secondary">Secondary</button>
  <button class="button button--outline">Outline</button>
  <button class="button button--ghost">Ghost</button>
  <button class="button button--danger">Danger</button>

  <!-- Button Sizes -->
  <button class="button button--sm">Small</button>
  <button class="button">Default</button>
  <button class="button button--lg">Large</button>

  <!-- Button States -->
  <button class="button" disabled>Disabled</button>
  <button class="button button--loading">Loading</button>
  <button class="button button--success">Success</button>

  <!-- Button with Icons -->
  <button class="button">📁 Open</button>
  <button class="button button--primary">💾 Save</button>
  <button class="button button--secondary">🗑️ Delete</button>

Accordion

The Accordion component allows users to expand and collapse sections of content. It is ideal for FAQs, menus, and any scenario where content needs to be revealed progressively.

  • Preview
  • Code

Content for section 1.

Content for section 2.

<div class="accordion" data-component="Accordion">...</div>

Tabs

The Tabs component organizes content into multiple panels, allowing users to switch between them without leaving the page. It is keyboard accessible and supports dynamic content.

Content for the first tab.

Content for the second tab.

<div class="tabs" data-component="Tabs">
      <div class="tabs__list" role="tablist">
          <button class="tabs__trigger active" role="tab" aria-selected="true" data-tab-target="#tab1">Tab 1</button>
          <button class="tabs__trigger" role="tab" aria-selected="false" data-tab-target="#tab2">Tab 2</button>
      </div>
      <div class="tabs__content active" id="tab1">...</div>
      <div class="tabs__content" id="tab2">...</div>
  </div>

Video Player

The Video Player component provides a responsive video player with auto-initialization. It supports local, Vimeo, and YouTube videos. Just add .video-player and data-video-url to your element.

Local Video Example:
Vimeo Example:
YouTube Example:
<!-- Local Video -->
<div class="video-example">
  <strong>Local Video Example:</strong>
  <div class="video-player" data-video-url="/sample-video.mp4"></div>
</div>

<!-- Vimeo -->
<div class="video-example">
  <strong>Vimeo Example:</strong>
  <div class="video-player" data-video-url="https://vimeo.com/76979871"></div>
</div>

<!-- YouTube -->
<div class="video-example">
  <strong>YouTube Example:</strong>
  <div class="video-player" data-video-url="https://www.youtube.com/watch?v=dQw4w9WgXcQ"></div>
</div>

Rive Animation

The Rive Animation component wraps the official Rive Web JS runtime, providing a design system-aligned interface for embedding interactive animations. It supports all Rive parameters and APIs with markup-driven configuration.

🎬 Enhanced Demo: View Scroll-Triggered Rive Animations →
Experience velocity-based triggers with reverse animation support

Basic Animation

Interactive Animation with Controls

Responsive Animation Variants

Full Width Animation

<!-- Basic Animation -->
<div class="rive rive--medium rive--bordered rive--shadow-sm" 
     data-component="RiveAnimation" 
     data-file="/vehicles.riv" 
     data-autoplay="true">
  <canvas></canvas>
</div>

<!-- Interactive Animation with Controls -->
<div class="rive rive--large rive--aspect-video rive--shadow-md" 
     data-component="RiveAnimation" 
     data-file="/vehicles.riv" 
     data-state-machines="bumpy" 
     data-autoplay="false">
  <canvas></canvas>
</div>

<!-- Responsive Variants -->
<div class="rive rive--small rive--aspect-square rive--rounded" 
     data-component="RiveAnimation" 
     data-file="/vehicles.riv" 
     data-autoplay="true">
  <canvas></canvas>
</div>

<!-- Full Container Animation -->
<div class="rive-example rive-example--full" style="height: 500px;">
  <div class="rive rive--fill-container rive--no-aspect rive--shadow-md" 
       data-component="RiveAnimation" 
       data-file="/vehicles.riv" 
       data-autoplay="true">
    <canvas></canvas>
  </div>
</div>

<!-- JavaScript Control -->
<script>
import { RiveAnimation } from '@mna-foundation/rive';

const rive = new RiveAnimation({ 
  element: document.querySelector('[data-component="RiveAnimation"]') 
});

function playRiveAnimation() {
  rive.play();
}

function pauseRiveAnimation() {
  rive.pause();
}

function triggerRiveBump() {
  const inputs = rive.stateMachineInputs('bumpy');
  const bumpTrigger = inputs.find(i => i.name === 'bump');
  if (bumpTrigger) bumpTrigger.fire();
}
</script>