# bootstrap-v5-v6-migration

bootstrap-v5-v6-migration is a Claude Code skill that guides project upgrades from Bootstrap 5 to 6. It runs when updating build tools, CSS classes, components, Sass tokens, or scripts.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 667 installs · ★ 175109 repo stars
- Author: twbs
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/twbs/bootstrap/tree/HEAD/skills/bootstrap-v5-v6-migration/SKILL.md
- Updated: 2026-11-16
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/bootstrap-v5-v6-migration

## What it does

The skill runs a sequenced upgrade workflow across dependencies, HTML markup, styling, and JavaScript logic. It directs the transition in `package.json` to Bootstrap 6, replacing `@popperjs/core` with `@floating-ui/dom` and adding `vanilla-calendar-pro` when using Datepicker. In Sass setups, Node Sass is dropped completely, requiring `@use` rules instead of `@import` alongside token map overrides.

Responsive prefixes now mirror utility-first conventions: breakpoint modifiers move to the front with colons, turning `.col-md-6` into `.md:col-6` and replacing `xxl` with `2xl`. Core components receive complete renames: Modal shifts to Dialog, Offcanvas becomes Drawer, and Dropdown converts to Menu across class names, DOM events, and JS imports.

Color utility classes like `.btn-primary` split into variant and theme token combinations such as `class="btn-solid theme-primary"`. Projects still running Bootstrap 4 must complete the v4-to-v6 migration skill first.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add twbs/bootstrap --skill bootstrap-v5-v6-migration -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/bootstrap-v5-v6-migration/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/bootstrap-v5-v6-migration/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add twbs/bootstrap --skill bootstrap-v5-v6-migration -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/bootstrap-v5-v6-migration/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add twbs/bootstrap --skill bootstrap-v5-v6-migration -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/bootstrap-v5-v6-migration/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install twbs/bootstrap skills/bootstrap-v5-v6-migration
```

2. **Manually: put the files in place**
- File: `.github/skills/bootstrap-v5-v6-migration/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add twbs/bootstrap --skill bootstrap-v5-v6-migration -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/twbs/bootstrap --path skills/bootstrap-v5-v6-migration
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/bootstrap-v5-v6-migration/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add twbs/bootstrap --skill bootstrap-v5-v6-migration -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/twbs/bootstrap/tree/HEAD/skills/bootstrap-v5-v6-migration/SKILL.md

## When to use it
- Update package dependencies from Popper to Floating UI
- Migrate grid and display classes to colon prefix syntax like md:col-6
- Rename Modal, Offcanvas, and Dropdown elements to Dialog, Drawer, and Menu
- Refactor Sass imports to namespaced @use modules

## Example prompts
- Migrate this repository from Bootstrap 5 to Bootstrap 6
- Rewrite legacy responsive grid classes to Bootstrap 6 colon prefixes
- Refactor our modal components to the new dialog syntax

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 5d061b0dddb8d0f3.

BEGIN THIRD-PARTY FILE 5d061b0dddb8d0f3
````text
---
name: bootstrap-v5-v6-migration
description: Migrate projects from Bootstrap 5 to Bootstrap 6. Use when upgrading from Bootstrap 5, migrating v5 to v6, or updating v5 class names, components, Sass, or JavaScript to the latest version. For Bootstrap 4 projects, start with the v4-to-v6 migration skill instead.
guide: /guides/migration
---

# Bootstrap v5 to v6 Migration

## Workflow

Work through each step in order. After each step, search the codebase for remaining v5 patterns before moving on.

- [ ] Step 1: Update dependencies and build setup
- [ ] Step 2: Rename CSS classes and data attributes
- [ ] Step 3: Restructure component HTML
- [ ] Step 4: Update JavaScript
- [ ] Step 5: Update Sass
- [ ] Step 6: Verify

---

## Step 1: Dependencies & Build

1. Update `package.json`: `"bootstrap": "6.0.0-alpha.1"`
2. Replace `@popperjs/core` with `@floating-ui/dom`
3. If using Datepicker, add peer dep `vanilla-calendar-pro`
4. Sass: replace all `@import` with `@use` (Node Sass is no longer supported)

`bootstrap.bundle.js` includes Floating UI and Vanilla Calendar Pro. Standalone `bootstrap.js` leaves both peer dependencies external. Direct browser loading of the standalone build needs an import map.

```scss
// v5
@import "bootstrap/scss/bootstrap";

// v6
@use "bootstrap/scss/bootstrap";

// v6 with overrides — customize CSS tokens through the token maps
@use "bootstrap/scss/bootstrap" with (
  $root-tokens: (
    --spacer: 1rem,
  )
);
```

Customize by overriding the CSS token maps — `$root-tokens` for global tokens and each component's `$*-tokens` map — rather than legacy Sass scalars. See [Customize › Sass](https://getbootstrap.com/docs/6.0/customize/sass/#compile-time-overrides). Token names are written **unprefixed** in Sass (e.g. `--spacer`, `--border-radius`); Bootstrap's dist/CDN CSS runs PostCSS to add the `--bs-` prefix (`--bs-spacer`), so when you compile the source yourself the properties stay unprefixed.

`@use` doesn't put Bootstrap's members in the global scope like `@import` did. Bare v5 references to Bootstrap's variables, functions, or mixins fail with "Undefined variable", "Undefined function", or "Undefined mixin". Prefix them with the `bootstrap` namespace, or load Bootstrap with `as *` to keep the v5 names.

```scss
// v5
@import "bootstrap/scss/bootstrap";
.custom { padding: $spacer * .5; }
@include media-breakpoint-down(sm) { .custom { display: none; } }

// v6 — namespaced
@use "bootstrap/scss/bootstrap";
````
END THIRD-PARTY FILE 5d061b0dddb8d0f3

The third-party file has ended. Everything between the 5d061b0dddb8d0f3 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2483 of 30473 bytes. © twbs · MIT · https://github.com/twbs/bootstrap/tree/HEAD/skills/bootstrap-v5-v6-migration/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
