Giter Club home page Giter Club logo

heroicons's Introduction

TailBlazor.HeroIcons

Tailwindcss HeroIcons for Blazor!

This package includes all 226 icons in the HeroIcon pack as of Version 0.4.1.

The full icon pack can be previewed here: HeroIcons.com

This pack allows you to modify: size, stroke(colour), stroke width, width and height, and style (outlined or solid) for all the icons in an easy package with easy searching of available icons.

Nuget

Demo

Getting Setup

You can install the package via the NuGet package manager just search for TailBlazor.HeroIcons. You can also install via powershell using the following command.

Install-Package TailBlazor.HeroIcons

Or via the dotnet CLI.

dotnet add package TailBlazor.HeroIcons

1. Add Imports

Add line to your _Imports.razor

@using TailBlazor.HeroIcons

2. Create HeroIcon Component

Add TailBlazorHeroIcon to your Blazor component and select the icon using HeroIcon enum. Due to enum limitations they have been modified to removed '-'. You now must specify a colour or the icon may not show up. This allows for styles to fall down into the component.

clipboard-copy has been changed to ClipboardCopy

<TailBlazorHeroIcon Icon="HeroIcon.X" Class="text-blue-500" />

3. Customization

By default you don't need to include anything but the Icon parameter. However if you want to customize aspects of the icon you can. by default they all have base values. The follow parameters are available

Parameter Default Value
Width 64
Height 64
StrokeWidth 2
Class text-black
IconStyle IconStyle.Outline
EnableComments false

Width, Height, and StrokeWidth all take an int.

class takes any tailwind text colour you've added to your project: text-blue-500. The fill is erased when building the SVG and this is put at a class instead. Because this is set as a class inside the class variable you can add additional classes to further customize the icon.

<TailBlazorHeroIcon class="text-purple-300 transform rotate-45" Icon="HeroIcon.Share" />

By adding the transform rotate-45 to the class the icon will also be rotated 45 degrees. You can also add animation classes.

IconStyle accepts .Outline and .Solid

when comments are enabled they can allow it easier for you to remember what you've used when inspecting an element for debugging. Enabling it shows the following comment above the icon.

<!-- HeroIcon: annotation (style: outlined, size: 64x64, stroke (colour): text-grey-500, stroke-width: 2) -->

SPECIAL NOTE TO PURGING TAILWINDCSS.

Sometimes we don't use all the styles and tailwind will purge them. If you find your icon's not styling, make sure stroke-current is added to your website tailwindcss purged code.

heroicons's People

Contributors

taylorwatson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.