Giter VIP home page Giter VIP logo

solid-heroicons's Introduction

Solid Heroicons with Lucide Icons

โš ๏ธ This is not an official implementation: All credits goes out to the Heroicons and Tailwind CSS team. :warning: I also added Lucide icons to the mix: All credits goes out to the Lucide team.

Heroicons integration for Solid with a twist of Lucide.

Demo

Installation

npm install solid-heroicons
yarn add solid-heroicons
pnpm add solid-heroicons

Usage

You can import every icon from heroicons solid, outline, or solid-mini from solid-heroicons/solid, solid-heroicons/outline and solid-heroicons/solid-mini respectively. Oh and the lucide icons are in the lucide package.

They are exported as camel case. Everything exported from those packages are just an object with the SVG path and a metadata to know whether it's been exported from the solid, outline or mini variant.

Those packages are generated automatically via a script from the heroicon repo.

You can import the Icon component helper from solid-heroicons. This is just a SVGElement wrapper that accepts any props a regular SVG would plus a special props path for the icon you want to load in.

By default the stroke | fill attribute of the SVG is set to currentColor which means you can give any color you want to the SVG by setting the css color attribute on SVG or any parent higher.

import { render } from "solid-js/dom";
import { Icon } from "solid-heroicons";
import { arrowLeft } from "solid-heroicons/solid";
import { arrowRight } from "solid-heroicons/outline";
import { arrowDown } from "solid-heroicons/solid-mini";
import { volume } from "solid-heroicons/lucide";

const App = () => (
  <>
    <Icon path={arrowLeft} style="width: 24px; color: blue" />
    <Icon path={arrowRight} style="width: 24px; color: green" />
    <Icon path={arrowDown} style="width: 20px; color: yellow" />
    <Icon path={volume} style="width: 24px; color: red" />
  </>
);

render(() => App, document.getElementById("app"));

solid-heroicons's People

Contributors

amoutonbrady avatar alexandre-mb-airweb avatar gnosticdev avatar davedbase avatar bsl-zcs avatar milomg avatar

Watchers

 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.