Humble.Umbraco.SvgHelpers
13.0.0.1
Prefix Reserved
dotnet add package Humble.Umbraco.SvgHelpers --version 13.0.0.1
NuGet\Install-Package Humble.Umbraco.SvgHelpers -Version 13.0.0.1
<PackageReference Include="Humble.Umbraco.SvgHelpers" Version="13.0.0.1" />
paket add Humble.Umbraco.SvgHelpers --version 13.0.0.1
#r "nuget: Humble.Umbraco.SvgHelpers, 13.0.0.1"
// Install Humble.Umbraco.SvgHelpers as a Cake Addin #addin nuget:?package=Humble.Umbraco.SvgHelpers&version=13.0.0.1 // Install Humble.Umbraco.SvgHelpers as a Cake Tool #tool nuget:?package=Humble.Umbraco.SvgHelpers&version=13.0.0.1
SVG Helpers
This code provides a comprehensive solution for rendering SVG icons from both the Umbraco backoffice and the file system while efficiently caching them in memory. It also generates a combined SVG sprite for improved performance and reusability in web applications.
TLDR;
Step 1: Use SVGs in your Razor Code
Render a Backoffice Icon:
<humble-icon name="facebook" />
Render a SVG File:
<humble-icon path="~/icons/1password.svg" />
Render all SVG Files in a Folder:
<humble-icon directory="~/my-icon-folder"></humble-icon>
Step 2: Ensure the SVG Symbols are Rendered
Render the SVG Sprite Directly:
<humble-sprite />
Setup and Configuration
Setup and configuration is a two-step process. After performing these steps, the tag helpers (mentioned above) will be available for use.
- Install
Humble.Umbraco.SvgHelpers
:
dotnet add package Humble.Umbraco.SvgHelpers
- Register the Tag Helpers in your
_ViewImports.cshtml
file:
...
@addTagHelper *, Humble.Umbraco.SvgHelpers
...
How to Find Support
- Use GitHub Issues to
report bugs
. - Use GitHub Discussions to
ask questions
,provide feedback
, andmake suggestions.
- Consider hiring our agency, Next Player Up, for your next project—innovative apps, immersive XR experiences, and AI solutions that'll exceed your expectations, not your budget. We are also a Umbraco Certified Gold Partner!
License
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
License information was last updated May 19th, 2024.
Release History
13.0.0.1
- SVG files were looked up using
WebRootPath
, this has been changed to useContentRootPath
so that files do not need to be included in/wwwroot/
.
13.0.0.0
- For Umbraco v13.x.x
- Render SVGs from the Umbraco Backoffice and file system with ease.
- Generates symbols so a single SVG icon can be referenced multiple times throughout your design.
You've reached the end of readme.md.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Umbraco.Cms.Core (>= 13.3.1)
- Umbraco.Cms.Web.Website (>= 13.3.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.