BootstrapIcons
The Bootstrap Icons library, packaged as a Wisej.NET icon pack: 1,386 SVG icons drawn on a 16 × 16 grid, many of them in both an outline and a -fill variant (alarm.svg and alarm-fill.svg). They match the look of the Bootstrap-4 theme, the default theme of new Wisej.NET applications, which uses the same icon family.
Installation
Add the Wisej-4-BootstrapIcons package to your Wisej.NET project, either with the NuGet Package Manager or from the command line:
dotnet add package Wisej-4-BootstrapIcons
The package targets .NET Framework 4.8 and .NET 8 or later. It contains one assembly, Wisej.Ext.BootstrapIcons.dll, and that DLL is all you deploy. There's nothing to register. After a rebuild, the pack appears as a folder in the Visual Studio ImageSource editor. See Picking icons in Visual Studio.
Browse the icons
Every icon in the pack, drawn from the SVG files the assembly embeds. Type to filter by file name or constant name, and select an icon for its constant, its resource.wx URL and a ready-to-paste assignment, each with a copy button. The icons are shown in the page's text color, the way they follow the theme's icon color in an application; the color swatch in the preview tries a ?color= value.
Using the icons
Every icon is an embedded SVG served at resource.wx/Wisej.Ext.BootstrapIcons/<file-name>. In code, use the constants of the static Wisej.Ext.BootstrapIcons.Icons class, which already hold the full URL:
- C#
- VB.NET
// The constant holds "resource.wx/Wisej.Ext.BootstrapIcons/printer.svg".
this.button1.ImageSource = Wisej.Ext.BootstrapIcons.Icons.Printer;
// The same icon by URL, for example when the name comes from data.
this.button1.ImageSource = "resource.wx/Wisej.Ext.BootstrapIcons/printer.svg";
// A specific color instead of the theme's icon color.
this.button1.ImageSource = Wisej.Ext.BootstrapIcons.Icons.Printer + "?color=SteelBlue";
' The constant holds "resource.wx/Wisej.Ext.BootstrapIcons/printer.svg".
Me.button1.ImageSource = Wisej.Ext.BootstrapIcons.Icons.Printer
' The same icon by URL, for example when the name comes from data.
Me.button1.ImageSource = "resource.wx/Wisej.Ext.BootstrapIcons/printer.svg"
' A specific color instead of the theme's icon color.
Me.button1.ImageSource = Wisej.Ext.BootstrapIcons.Icons.Printer & "?color=SteelBlue"
The URL works in any property that takes an image source (ImageSource, Icon, BackgroundImageSource, …), and also in HTML and CSS.
Icon names
Each constant of the Icons class is the file name in PascalCase:
| File | Constant |
|---|---|
house.svg | Icons.House |
house-door.svg | Icons.HouseDoor |
printer.svg | Icons.Printer |
gear.svg | Icons.Gear |
Colors
Every icon is drawn with fill="currentColor", so it follows the theme's icon color and responds to ?color=. Use a named color, #rrggbb, rgb()/rgba(), or the name of a theme color (for example ?color=activeText). See SVG Colors.
License
Bootstrap Icons are released under the MIT license. The Wisej.NET wrapper assembly is part of the Wisej.NET extensions.
See also
- Icon packs overview
- Images in the user guide
- Embedded Resources in the user guide