npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-mission-control

v1.0.3

Published

macOS Mission Control-like experience for React applications

Readme

react-mission-control

A React library that provides macOS Mission Control / Exposé-like window management for web applications. Activate it to see all your components in a grid view, then click to navigate.

npm version license

Features

  • macOS Mission Control-style grid view for React components
  • Keyboard shortcut activation (customizable)
  • Smooth animations with CSS transitions
  • Mobile-friendly with touch support and vertical card stack
  • Accessible with full keyboard navigation and ARIA support
  • Respects prefers-reduced-motion
  • Fully customizable via CSS variables
  • TypeScript support

Installation

npm install react-mission-control
# or
pnpm add react-mission-control
# or
yarn add react-mission-control

Quick Start

import { MCProvider, MCWrapper } from "react-mission-control";
import "react-mission-control/styles.css";

function App() {
  return (
    <MCProvider>
      <MCWrapper label="Header">
        <Header />
      </MCWrapper>

      <MCWrapper label="Main Content">
        <MainContent />
      </MCWrapper>

      <MCWrapper label="Sidebar">
        <Sidebar />
      </MCWrapper>
    </MCProvider>
  );
}

Press Arrow Up twice quickly (or your custom shortcut) to activate Mission Control. Press Escape to deactivate.

Components

<MCProvider>

Wrap your app with this provider to enable Mission Control functionality.

<MCProvider
  shortcut="ArrowUp+ArrowUp"  // Default: double-tap Arrow Up
  blurAmount={10}              // Background blur in pixels
  onActivate={() => {}}        // Callback when activated
  onDeactivate={() => {}}      // Callback when deactivated
  ariaLabel="Mission Control"  // Accessible label
>
  {children}
</MCProvider>

| Prop | Type | Default | Description | |------|------|---------|-------------| | shortcut | string | "ArrowUp+ArrowUp" | Keyboard shortcut to activate. Supports modifiers like "Control+ArrowUp" | | blurAmount | number | 10 | Background blur amount in pixels | | onActivate | () => void | - | Callback fired when Mission Control activates | | onDeactivate | () => void | - | Callback fired when Mission Control deactivates | | ariaLabel | string | "Mission Control view" | Accessible label for the dialog |

<MCWrapper>

Wrap any component you want to appear in the Mission Control grid.

<MCWrapper
  label="My Component"   // Label shown on hover
  id="unique-id"         // Optional custom ID
  className="custom"     // Additional CSS classes
  style={{ ... }}        // Inline styles
>
  <YourComponent />
</MCWrapper>

| Prop | Type | Default | Description | |------|------|---------|-------------| | label | string | - | Label displayed on hover (desktop) or always visible (mobile) | | id | string | auto-generated | Unique identifier for the component | | className | string | "" | Additional CSS classes | | style | CSSProperties | {} | Inline styles |

<MCTrigger>

A button component to manually trigger Mission Control.

import { MCTrigger } from "react-mission-control";

<MCTrigger className="my-button">
  Open Mission Control
</MCTrigger>

Hooks

useIsMCActive()

Returns whether Mission Control is currently active.

import { useIsMCActive } from "react-mission-control";

function MyComponent() {
  const isActive = useIsMCActive();
  return <div>{isActive ? "MC is open" : "MC is closed"}</div>;
}

useMCActions()

Returns actions to control Mission Control programmatically.

import { useMCActions } from "react-mission-control";

function MyComponent() {
  const { activate, deactivate, setActive } = useMCActions();

  return (
    <button onClick={activate}>
      Open Mission Control
    </button>
  );
}

mcActions

Direct access to actions without hooks (useful outside React components).

import { mcActions } from "react-mission-control";

// Can be called anywhere
mcActions.activate();
mcActions.deactivate();

Customization

Customize the appearance using CSS variables:

:root {
  /* Colors */
  --mc-highlight: rgba(64, 156, 255, 0.85);
  --mc-highlight-muted: rgba(64, 156, 255, 0.7);
  --mc-backdrop-bg: rgba(0, 0, 0, 0.3);
  --mc-label-bg: rgba(0, 0, 0, 0.75);
  --mc-label-color: white;
  --mc-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);

  /* Dimensions */
  --mc-border-radius: 8px;
  --mc-border-width: 3px;
  --mc-label-font-size: 12px;
  --mc-label-padding: 4px 8px;

  /* Animations */
  --mc-transition-duration: 0.2s;
  --mc-transition-easing: cubic-bezier(0.16, 1, 0.3, 1);
  --mc-backdrop-duration: 0.3s;
  --mc-blur-amount: 10px;

  /* Mobile */
  --mc-mobile-card-height: 20vh;
  --mc-mobile-card-width: 85vw;
  --mc-mobile-card-gap: 12px;
  --mc-mobile-card-radius: 12px;
}

Mobile Support

On viewports smaller than 768px, Mission Control automatically switches to a vertical scrollable card stack (similar to Safari's tab switcher on iOS). Cards snap into place with smooth scrolling.

Accessibility

  • Full keyboard navigation with Tab/Shift+Tab
  • Focus trap when active
  • ARIA labels and roles
  • Escape key to close
  • Respects prefers-reduced-motion for users who prefer reduced animations

Browser Support

  • Chrome/Edge 88+
  • Firefox 78+
  • Safari 14+

Legacy API

For backward compatibility, the library also exports the previous API names:

// These work the same as the MC* versions
import {
  ExposeProvider,    // = MCProvider
  ExposeWrapper,     // = MCWrapper
  ExposeTrigger,     // = MCTrigger
  useIsExposeActive, // = useIsMCActive
  useExposeActions,  // = useMCActions
  exposeActions,     // = mcActions
} from "react-mission-control";

License

MIT