Giter Club home page Giter Club logo

leptos_heroicons's Introduction

Leptos Heroicons

Heroicons Components for Leptos

Usage

For each icon you want to use, you'll need to add a feature flag for those components. Only the icons you specify will be compiled into your application.

leptos_heroicons = { git = "https://github.com/bbstilson/leptos_heroicons.git", features = [
    "24-solid-power",
    "24-outline-wrench",
    "20-solid-credit-card"
]}

You can also include all the icons of a given type by specifying the size-type feature:

leptos_heroicons = { git = "https://github.com/bbstilson/leptos_heroicons.git", features = [
    "24-solid",
    "24-outline",
    "20-solid",
    "16-solid"
]}

In your leptos app:

use leptos::*;
use leptos_heroicons::size_24::solid::Power;

#[component]
fn UnlimitedPower() -> impl IntoView {
    view! { <Power /> }
}

Why Git and not Cargo version?

See this blog post from the Rust team. TL;DR: The max number of features any crate can publish is 300, and this library would need to publish around 1200. While the Rust team sorts out how best to support a large number of crate features, you will need to depend on the repo directly.

Inspiration / Credit

leptos_heroicons's People

Contributors

bbstilson avatar stefanboere avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

leptos_heroicons's Issues

Tailwind classes not applying to icons

I'm trying to use tailwind classes to style icons imported from this library and it's not working. There is a small reproducible project here. You will see the issue with the style not applying to the bell icon in the nav component.

I'm not sure if this is a problem with my setup or the library. Help would be appreciated.

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.