This repository contains Blazor components built on top of the Shoelace library, enabling developers to use Shoelace UI elements in their Blazor applications.
- .NET SDK (8.0 or higher)
- A Blazor application (Blazor Server or Blazor WebAssembly)
-
Install the nuget package:
dotnet add package Shoelace.Style --version 1.0.0.4
-
Download the latest version of the
@shoelace-style
package. We suggest using libman with this configuration:{ "version": "1.0", "defaultProvider": "jsdelivr", "libraries": [ { "library": "@shoelace-style/shoelace@2.17.1", "destination": "wwwroot/shoelace/", "files": [ "cdn/!(react)/**/*.{js,svg,css}", "cdn/*.js" ] } ] }
-
Add the links to reference the css and js in index.html/App.razor/_Host.cshtml:
<link rel="stylesheet" media="(prefers-color-scheme:light)" href="shoelace/cdn/themes/light.min.css" /> <link rel="stylesheet" media="(prefers-color-scheme:dark)" href="shoelace/cdn/themes/dark.min.css" onload="document.documentElement.classList.add('sl-theme-dark');" />
<script src="shoelace/cdn/shoelace-autoloader.min.js" type="module" data-shoelace="/shoelace/cdn"></script>
Or follow the instructions in the Installation page of the main site.
Import the main namespaces inside the _Import.razor file:
@using Shoelace.Style.Components
@using Shoelace.Style.Services
Add the service collection extension in you Program.cs:
builder.Services.AddShoelaceStyle();
- Alert (
<sl-alert>
) - Animated Image (
<sl-animated-image>
) - Animation (
<sl-animation>
) - Avatar (
<sl-avatar>
) - Badge (
<sl-badge>
) - Breadcrumb (
<sl-breadcrumb>
) - Breadcrumb Item (
<sl-breadcrumb-item>
) - Button (
<sl-button>
) - Button Group (
<sl-button-group>
) - Card (
<sl-card>
) - Carousel (
<sl-carousel>
) - Carousel Item (
<sl-carousel-item>
) - Checkbox (
<sl-checkbox>
) - Color Picker (
<sl-color-picker>
) - Copy Button (
<sl-copy-button>
) - Details (
<sl-details>
) - Dialog (
<sl-dialog>
) - Divider (
<sl-divider>
) - Drawer (
<sl-drawer>
) - Dropdown (
<sl-dropdown>
) - Format Bytes (
<sl-format-bytes>
) - Format Date (
<sl-format-date>
) - Format Number (
<sl-format-number>
) - Icon (
<sl-icon>
) - Icon Button (
<sl-icon-button>
) - Image Comparer (
<sl-image-comparer>
) - Include (
<sl-include>
) - Input (
<sl-input>
) - Menu (
<sl-menu>
) - Menu Item (
<sl-menu-item>
) - Menu Label (
<sl-menu-label>
) - Mutation Observer (
<sl-mutation-observer>
) - Option (
<sl-option>
) - Popup (
<sl-popup>
) - Progress Bar (
<sl-progress-bar>
) - Progress Ring (
<sl-progress-ring>
) - QR Code (
<sl-qr-code>
) - Radio (
<sl-radio>
) - Radio Button (
<sl-radio-button>
) - Radio Group (
<sl-radio-group>
) - Range (
<sl-range>
) - Rating (
<sl-rating>
) - Relative Time (
<sl-relative-time>
) - Resize Observer (
<sl-resize-observer>
) - Select (
<sl-select>
) - Skeleton (
<sl-skeleton>
) - Spinner (
<sl-spinner>
) - Split Panel (
<sl-split-panel>
) - Switch (
<sl-switch>
) - Tab (
<sl-tab>
) - Tab Group (
<sl-tab-group>
) - Tab Panel (
<sl-tab-panel>
) - Tag (
<sl-tag>
) - Textarea (
<sl-textarea>
) - Tooltip (
<sl-tooltip>
) - Tree (
<sl-tree>
) - Tree Item (
<sl-tree-item>
) - Visually Hidden (
<sl-visually-hidden>
)
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new feature branch (
git checkout -b feature/YourFeature
). - Make your changes and commit them (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/YourFeature
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
For questions or support, please contact Koja Dennis.