Theming
Customize the look and feel of your documentation
Customize the appearance of your API documentation using Scalar UI themes and configuration options. Control colors, layout, and visual elements to match your brand.
What is Scalar Theming?
Scalar UI provides built-in themes and customization options to style your API documentation. You can choose from pre-built themes, customize the layout, and add your own CSS.
Configuration
Define Scalar UI theming in your config/swagger.ts file:
import { defineConfig } from "adonis-open-swagger";
export default defineConfig({
scalar: {
theme: "purple",
layout: "modern",
showSidebar: true,
customCss: ".scalar-card { border-radius: 8px; }",
},
});Scalar Properties
The scalar object supports the following properties:
theme (optional)
Choose a color theme for your documentation. Use auto for automatic light/dark detection based on user preferences.
Available themes:
auto- Automatic light/dark detectionalternate- Alternative color schemedefault- Default Scalar thememoon- Dark theme with blue accentspurple- Purple accent themesolarized- Solarized color palettebluePlanet- Blue planet themesaturn- Saturn-inspired themekepler- Kepler thememars- Mars-inspired red themedeepSpace- Deep space dark themelaserwave- Synthwave-inspired themeelysiajs- ElysiaJS themenone- No theme styling
{
scalar: {
theme: "purple";
}
}layout (optional)
Choose the layout style for your documentation interface.
Available layouts:
modern- Modern, streamlined layoutclassic- Traditional documentation layout
{
scalar: {
layout: "modern";
}
}showSidebar (optional)
Control whether the sidebar navigation is visible by default.
{
scalar: {
showSidebar: true;
}
}customCss (optional)
Add custom CSS to further customize the appearance of your documentation.
{
scalar: {
customCss: `
.scalar-card {
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
`;
}
}configuration (optional)
Additional Scalar configuration options. This accepts any valid Scalar configuration as a key-value object.
{
scalar: {
configuration: {
hideModels: false,
searchHotKey: "k",
};
}
}Last updated on