Skip to content
Skills Library
Programming · Building & coding

mitosis

/mitosis

Use when writing cross-framework UI components with Mitosis (Builder.io). Write components once in a JSX subset, compile to React, Vue, Angular, Svelte, Solid, Qwik, and more. USE FOR: Mitosis component authoring, cross-framework component compilation, multi-framework design system components, Mitosis JSX syntax, mitosis.config.js DO NOT USE FOR: single-framework components (use the framework's own skill), design token management (use design-tokens or style-dictionary), component documentation (use storybook)

Licence
MIT
Last repository change
09.06.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
13
Scripts
0
HTML comments
0
URLs in SKILL.md
2
Deprecation

No signals detected. Repository changed on 09.06.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when writing cross-framework UI components with Mitosis (Builder.io). Write components once in a JSX subset, compile to React, Vue, Angular, Svelte, Solid, Qwik, and more. USE FOR: Mitosis component authoring, cross-framework component compilation, multi-framework design system components, Mitosis JSX syntax, mitosis.config.js DO NOT USE FOR: single-framework components (use the framework's own skill), design token management (use design-tokens or style-dictionary), component documentation (use storybook)

Original author description

Use when writing cross-framework UI components with Mitosis (Builder.io). Write components once in a JSX subset, compile to React, Vue, Angular, Svelte, Solid, Qwik, and more. USE FOR: Mitosis component authoring, cross-framework component compilation, multi-framework design system components, Mitosis JSX syntax, mitosis.config.js DO NOT USE FOR: single-framework components (use the framework's own skill), design token management (use design-tokens or style-dictionary), component documentation (use storybook)

How it works

  1. Overview
  2. How It Works
  3. Supported Targets
  4. Getting Started
  5. Component Syntax
  6. Intermediate JSON
  7. Configuration
  8. CLI Commands
  9. JSX Subset Rules
  10. Figma Integration
Original SKILL.md headings · 258 lines, 893 words
SKILL.md preview
---
name: mitosis
description: |
    Use when writing cross-framework UI components with Mitosis (Builder.io). Write components once in a JSX subset, compile to React, Vue, Angular, Svelte, Solid, Qwik, and more.
    USE FOR: Mitosis component authoring, cross-framework component compilation, multi-framework design system components, Mitosis JSX syntax, mitosis.config.js
    DO NOT USE FOR: single-framework components (use the framework's own skill), design token management (use design-tokens or style-dictionary), component documentation (use storybook)
license: MIT
metadata:
  displayName: "Mitosis"
  author: "Tyler-R-Kendrick"
compatibility: claude, copilot, cursor
references:
  - title: "Mitosis — GitHub Repository (Builder.io)"
    url: "https://github.com/BuilderIO/mitosis"
  - title: "Mitosis Documentation"
    url: "https://mitosis.builder.io/"
---

# Mitosis — Write Once, Compile Everywhere

## Overview
Mitosis (by Builder.io) is a compile-time framework that lets you write UI components in a static JSX subset, then compile them to React, Vue, Angular, Svelte, Solid, Qwik, React Native, Web Components, and more. It's the key intermediary format for design systems that need to ship components to multiple frameworks from a single source.

## How It Works
```
Mitosis JSX (.lite.tsx)
        │
        ▼
   ┌──────────┐
   │  Parse    │  JSX → Mitosis JSON (intermediate AST)
   └────┬─────┘
        ▼
   ┌──────────┐
   │ Compile   │  JSON → Target framework code
   └────┬─────┘
        ▼
React, Vue, Angular, Svelte, Solid, Qwik, Lit, Stencil, RN, ...
```

## Supported Targets
| Target | Output |
|--------|--------|
| React | `.tsx` with hooks |
| Vue (3) | `.vue` SFC with Composition API |
| Angular | `.component.ts` with decorators |
| Svelte | `.svelte` SFC |
| Solid | `.tsx` with signals |
| Qwik | `.tsx` with `$` closures |
| React Native | `.tsx` with RN primitives |
| Lit | `.ts` with LitElement |
| Stencil | `.tsx` Web Components |
| Web Components | Vanilla custom elements |
| Swift (beta) | SwiftUI views |

## Getting Started
```bash
# Create a new Mitosis project
npm create @builder.io/mitosis@latest

# Or add to an existing project
npm install @builder.io/mitosis-cli @builder.io/mitosis
```

## Component Syntax
Mitosis uses a **static subset of JSX** — no arbitrary JS expressions, hooks, or closures. This constraint enables reliable compilation to any target.

### Basic Component
```tsx
// Button.lite.tsx
import { useStore } from "@builder.io/mitosis";

export default function Button(props) {
  const state = useStore({
    count: 0,
  });

  return (
    <button
      class={`btn btn-${props.variant}`}
      onClick={() => (state.count = state.count + 1)}
    >
      {props.children} ({state.count})
    </button>
  );
}
```

### Props
Props are received as the function argument and accessed via `props.name`:
```tsx
export default function Avatar(props) {
  return (
    <img
      src={props.src}
      alt={props.alt}
      class={`avatar avatar-${props.size || "md"}`}
    />
  );
}
```

### State (`useStore`)
`useStore` creates a reactive state object. Mutate properties directly:
```tsx
const state = useStore({
  isOpen: false,
  items: [],
});

// Toggle
state.isOpen = !state.isOpen;

// Update array (replace, don't push)
state.items = [...state.items, newItem];
```

### Conditional Rendering
Use the `<Show>` component (not ternaries in JSX):
```tsx
import { Show } from "@builder.io/mitosis";

export default function Alert(props) {
  return (
    <Show when={props.visible}>
      <div class="alert">{props.message}</div>
    </Show>
  );
}
```

### Loops
Use the `<For>` component (not `.map()`):
```tsx
import { For } from "@builder.io/mitosis";

export default function List(props) {
  return (
    <ul>
      <For each={props.items}>
        {(item) => <li key={item.id}>{item.name}</li>}
      </For>
    </ul>
  );
}
```

### Event Handlers
Inline arrow functions only — no function references:
```tsx
<button onClick={() => (state.count = state.count + 1)}>+</button>
<input onInput={(event) => (state.query = event.target.value)} />
```

### Styles
Use the `<style>` JSX element or `css` prop:
```tsx
export default function Card(props) {
  return (
    <>
      <div class="card">{props.children}</div>
      <style>{`
        .card {
          padding: 1rem;
          border-radius: 8px;
          box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
      `}</style>
    </>
  );
}
```

### Refs
```tsx
import { useRef } from "@builder.io/mitosis";

export default function Input(props) {
  const inputRef = useRef(null);

  function focusInput() {
    inputRef.focus();
  }

  return <input ref={inputRef} />;
}
```

## Intermediate JSON
Mitosis parses JSX into a framework-agnostic JSON AST:
```json
{
  "@type": "@builder.io/mitosis/component",
  "state": {
    "count": 0
  },
  "children": [
    {
      "@type": "@builder.io/mitosis/node",
      "name": "button",
      "bindings": {
        "onClick": "state.count = state.count + 1"
      },
      "children": [{ "@type": "@builder.io/mitosis/text", "text": "Click" }]
    }
  ]
}
```

This JSON is the intermediary format — custom compilers can consume it to generate output for any target.

## Configuration
```js
// mitosis.config.js
module.exports = {
  files: "src/**/*.lite.tsx",
  targets: ["react", "vue", "svelte", "angular"],
  dest: "output",
  options: {
    react: {
      typescript: true,
      stylesType: "style-tag",
    },
    vue: {
      api: "composition",
      typescript: true,
    },
    angular: {
      standalone: true,
    },
    svelte: {
      typescript: true,
    },
  },
};
```

## CLI Commands
```bash
# Compile all components to all targets
npx mitosis compile

# Compile to a specific target
npx mitosis compile --to=react

# Watch mode
npx mitosis compile --watch
```

## JSX Subset Rules
Mitosis enforces a static JSX subset for reliable cross-compilation:

| Allowed | Not Allowed |
|---------|-------------|
| `useStore` for state | React hooks (`useState`, `useEffect`) |
| `<Show when={}>` | Ternary in JSX (`{x ? a : b}`) |
| `<For each={}>` | `.map()` in JSX |
| Inline arrow event handlers | Function references as handlers |
| `props.name` access | Destructured props |
| Direct state mutation | Immutable update patterns |

## Figma Integration
Mitosis integrates with Figma to convert designs into `.lite.tsx` components:
- Import Figma frames as Mitosis components
- Map Figma variants to component props
- Keep design and code in sync

## Best Practices
- Use the `.lite.tsx` extension for Mitosis components to distinguish them from framework-specific files.
- Use `<Show>` and `<For>` instead of ternaries and `.map()` — these are the only control flow patterns that compile reliably to all targets.
- Keep state mutations simple — assign directly to `state.property`, avoid complex expressions.
- Use the Mitosis Playground (mitosis.builder.io/playground) to verify compilation output before committing.
- Configure per-target options in `mitosis.config.js` for framework-specific needs (TypeScript, composition API, standalone components).
- Pair with Style Dictionary to inject design tokens — Mitosis handles components, Style Dictionary handles tokens.
- Test the compiled output in each target framework's Storybook, not just the Mitosis source.
Files in this package (13)
  • AGENTS.md 6 KB
  • README.md 1 KB
  • SKILL.md 7 KB
  • metadata.json 1 KB
  • rules/_sections.md 1 KB
  • rules/_template.md 1 KB
  • rules/mitosis-configure-per-target-options-in-mitosis.md 1 KB
  • rules/mitosis-keep-state-mutations-simple.md 1 KB
  • rules/mitosis-pair-with-style-dictionary-to-inject-design-tokens.md 1 KB
  • rules/mitosis-test-the-compiled-output-in-each-target-framework-s.md 1 KB
  • rules/mitosis-use-show-and-for-instead-of-ternaries-and.md 1 KB
  • rules/mitosis-use-the-lite.md 1 KB
  • rules/mitosis-use-the-mitosis-playground-mitosis.md 1 KB

Versions

The database has no other skills named mitosis.

Database snapshot: 13.11.2026 · package version c9644ee42d3c (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 91frontend-development
    Multi-framework frontend development:React 18+ (Suspense/hooks/TanStack), Vue 3 (Composition API), Svelte 5 (Runes), Angular (Signals). Use for components/pages, TypeScript, state management, routing, data fetching, performance. Keywords:React, Vue, Svelte, Angular, component, hooks.
  • 100storybook
    Use when documenting, developing, or testing UI components with Storybook. Covers CSF3, CSF Factories, play functions, Args, interaction testing, and addon configuration. USE FOR: Storybook stories (CSF3 and CSF Factories), play functions, Args and ArgTypes, interaction testing,…
  • 80Frontend Components
    Design reusable, composable UI components with single responsibility, clear interfaces, and proper state management. Use this skill when creating or refactoring React, Vue, Svelte, or other framework components. When defining component props, interfaces, or APIs. When managing…
  • 100design-code
    Generate production-ready, accessible, token-driven component code for ANY framework (React+Tailwind, Next.js, SwiftUI, Vue, Svelte, Angular, Solid, Web Components/Lit, React Native, Flutter, Jetpack Compose, vanilla CSS, or CSS-in-JS). Use when the user wants working UI code…
  • 100angular
    Angular 17+ with standalone components and signals. Covers components, services, dependency injection, and reactive patterns. USE WHEN: user mentions "Angular", "standalone components", "signals", "dependency injection", "RxJS", "NgModules", asks about "Angular 17 patterns",…
  • 90Custom Component Builder
    Build custom React/JSX interface components with the @noclick/sdk. Use when the user asks to create a custom component, build an interface, create a dashboard, add a custom UI, use the SDK, or mentions component, interface-html-react, jsx_source, fullscreen component, or @noclick/sdk.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.