Modernize your ASP.NET Core Swagger UI with runtime theme switching, deep customization, and new functional UI features.
$ dotnet add package AspNetCore.SwaggerUI.ThemesSwitch themes at runtime • Unlock new capabilities • Create and choose your custom style • ...and more!
Get Started • View Built-in Themes • Full Documentation
⚠️ Version 3.x Breaking Changes
Upgrading from v2.x? Please review the Migration Guide for important API changes.
dotnet add package AspNetCore.SwaggerUI.Themes
// Apply a theme
app.UseSwaggerUI(Theme.Dark);
// Or enable runtime theme switcher!
app.UseSwaggerUI(Theme.Dark, c => c.EnableThemeSwitcher());
Note: The
UseSwaggerUI()method is provided by Swashbuckle.AspNetCore. This package adds convenient overloads to apply themes seamlessly.
🔥 Theme Switcher - Switch built-in and custom themes dynamically without page reload
Built-in Themes - Choose from predefined themes ready to use
Custom Themes - Build your own themes with full control, or create standalone themes with zero dependencies
Advanced Features - Enhance your documentation with powerful UI capabilities
...discover more in the Wiki!
using AspNetCore.Swagger.Themes;
...
// Use a built-in theme
app.UseSwaggerUI(Theme.Dark);
// Enable theme switcher with auto-discovery
app.UseSwaggerUI(Theme.Dark, c =>
{
c.EnableThemeSwitcher();
});
// Or with all advanced features
app.UseSwaggerUI(Theme.Dark, c =>
{
c.EnableAllAdvancedOptions();
});
// Or use your custom theme from assembly
app.UseSwaggerUI(Assembly.GetExecutingAssembly(), "my-theme.css", c =>
{
c.EnableThemeSwitcher(); // Works with custom themes too!
});
...