wshaddix/dotnet-skills/bootstrap5-ui
Claude Code and agent skill by wshaddix/dotnet-skills
- community
Checking that the SKILL.md file is still in the repository.
Production-grade Bootstrap 5.3 patterns for building modern, responsive web UIs in HTML and ASP.NET Core Razor Pages/Views. Use when creating or styling web pages, layouts, navigation, forms, cards, modals, tables, or any UI component with Bootstrap 5. Covers the grid system, responsive breakpoints, utility classes, color modes (dark/light), accessibility, and integration with ASP.NET Core tag helpers and Razor syntax. Trigger on any task involving Bootstrap CSS classes, responsive HTML layouts, Razor Page UI design, or front-end styling for .NET web applications.
Install
npx vskill@latest install wshaddix/dotnet-skills/bootstrap5-uiSKILL.md
Bootstrap 5 UI
Production patterns for building responsive, accessible web UIs with Bootstrap 5.3 in HTML and ASP.NET Core Razor Pages/Views. Target Bootstrap 5.3.x (current CDN: 5.3.8). Bootstrap 5 dropped jQuery dependency entirely.
Setup in ASP.NET Core
CDN (Quick Start)
In _Layout.cshtml or _Host.cshtml:
LibMan (Recommended for Production)
Reference locally in layout:
Required Globals
Always include in <head>:
Grid System
Bootstrap uses a 12-column flexbox grid with 6 responsive breakpoints:
| Breakpoint | Prefix | Min-width | |
|---|---|---|---|
| Extra small | .col- | <576px | |
| Small | .col-sm- | >=576px | |
| Medium | .col-md- | >=768px | |
| Large | .col-lg- | >=992px | |
| Extra large | .col-xl- | >=1200px | |
| XXL | .col-xxl- | >=1400px |
Core Pattern
Key Rules
- Always wrap columns in
.rowinside a.container(or.container-fluidfor full-width) - Columns must be direct children of rows
- Use
.g-*classes for gutters (.g-0removes gutters,.gx-*horizontal,.gy-*vertical) - Use
.row-cols-*on the row for uniform column counts:<div class="row row-cols-1 row-cols-md-3 g-4"> - Mix breakpoints:
<div class="col-6 col-md-4 col-lg-3">— stacks to 2-up on xs, 3-up on md, 4-up on lg
Container Types
.container— responsive fixed-width.container-fluid— full-width always.container-{breakpoint}— fluid until breakpoint, then fixed
Spacing Utilities
Format: {property}{sides}-{breakpoint}-{size}
Property: m (margin), p (padding) Sides: t top, b bottom, s start(left), e end(right), x horizontal, y vertical, blank = all Size: 0=0, 1=0.25rem, 2=0.5rem, 3=1rem, 4=1.5rem, 5=3rem, auto
Color Modes (Dark/Light)
Bootstrap 5.3 supports data-bs-theme attribute for dark mode:
Use semantic color classes that adapt to color mode:
bg-body,bg-body-secondary,bg-body-tertiary— adapt to themetext-body,text-body-secondary,text-body-emphasis— adapt to themeborder-body— adapts to theme
Avoid hardcoded colors. Use bg-body-tertiary instead of bg-light for theme-aware backgrounds.
Common Component Patterns
Navbar
Cards in Grid
Forms
Floating Labels
Responsive Table
Razor Pages Integration
For detailed ASP.NET Core Razor Pages integration patterns including tag helpers, validation, layouts, and partial views, see references/razor-integration.md.
Key points:
- Use
asp-for,asp-page,asp-actiontag helpers with Bootstrap classes - Combine
asp-validation-forwith.invalid-feedback/.is-invalidclasses - Place Bootstrap validation classes via jQuery Validation Unobtrusive or custom JS
- Use
@section Scriptsfor page-specific scripts in layout
Component Reference
For complete component patterns (modals, alerts, toasts, accordion, pagination, breadcrumbs, badges, offcanvas, spinners, progress bars), see references/components.md.
Utility Classes Quick Reference
Display
d-none, d-block, d-flex, d-grid, d-inline, d-inline-block Responsive: d-md-none, d-lg-flex
Flexbox
justify-content-{start|center|end|between|around|evenly} align-items-{start|center|end|stretch} flex-{row|column}, flex-wrap, flex-grow-1
Text
text-{start|center|end}, text-{lowercase|uppercase|capitalize} fw-{bold|semibold|normal|light}, fs-{1-6} text-truncate, text-nowrap, text-break
Colors
text-{primary|secondary|success|danger|warning|info|light|dark} bg-{primary|secondary|success|danger|warning|info|light|dark} text-bg-{color} — sets matching text+bg together
Borders & Shadows
border, border-{top|bottom|start|end}, border-{color}, border-{1-5} rounded, rounded-{0-5|circle|pill} shadow, shadow-sm, shadow-lg, shadow-none
Sizing
w-{25|50|75|100|auto}, h-{25|50|75|100|auto} mw-100, mh-100, vw-100, vh-100 min-vw-100, min-vh-100
Position
position-{static|relative|absolute|fixed|sticky} top-{0|50|100}, start-{0|50|100}, translate-middle
Accessibility Requirements
- Always include
aria-labelon icon-only buttons and togglers - Use
aria-current="page"on active nav links - Use
aria-expandedon collapse/dropdown triggers - Provide
alttext on images; use.visually-hiddenfor screen-reader-only text - Ensure color contrast meets WCAG 2.1 AA (4.5:1 for text, 3:1 for large text)
- Use semantic HTML:
<nav>,<main>,<header>,<footer>,<section>,<article> - Never remove
:focusstyles; use Bootstrap's.focus-ringutility for custom focus
Anti-Patterns
- Using
col-*without a parent.row— breaks grid alignment - Nesting containers — only nest rows, never containers inside containers
- Using
<br>and inline styles for spacing — use spacing utilities (mt-3,mb-4) - Hardcoding
bg-light/bg-dark— usebg-body-tertiaryfor theme-aware backgrounds - Forgetting
navbar-expand-{breakpoint}— navbar won't collapse responsively - Mixing Bootstrap 4 classes (e.g.,
ml-3,mr-3) — usems-3,me-3(start/end logical properties) - Omitting
type="button"on non-submit buttons in forms — causes unintended form submission - Using
<a>for actions withouthref— use<button>for actions,<a>for navigation - Skipping
.form-labelon form inputs — hurts accessibility - Not wrapping tables in
.table-responsive— causes horizontal overflow on mobile
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/bootstrap5-ui/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 3
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/wshaddix/dotnet-skills/bootstrap5-ui)