Getting started with Bootstrap 5 for DotVVM

To use the Bootstrap 5 for DotVVM controls, you have use the DotVVM Private Nuget Feed.

  1. Install the DotVVM.Controls.Bootstrap5 package from the DotVVM Private Nuget Feed.

  2. Open your DotvvmStartup.cs file and add the following line at the beginning of the Configure method.

config.AddBootstrap5Configuration();

You might need to add the following using at the beginning of the file.

using DotVVM.Bootstrap5.Controls;

This will register all Bootstrap controls under the <bs:* tag prefix, and it also registers several Bootstrap resources. Bootstrap 5 for DotVVM also includes Bootstrap Icons font. All icons could are available using <bs:Icon> control.

CSS Variables Configuration

Bootstrap 5 allows altering properties with CSS variables. You can replace them with your own values in your CSS file.


/* Override global variable */
body {
    --bs-body-font-size: 2rem;
}

/* Override accordion variable */
.accordion-button:not(.collapsed) {
    --bs-accordion-active-bg: #00ff90 !important;
}

Usage

The usage of each control is shown in the controls documentation.