npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

qwik-ionicons

v1.0.5

Published

Ionicons for Qwik ⚡️

Downloads

299

Readme

⚡️ Ionicons for Qwik

  1. Are you using the Qwik framework 🔗?
  2. Do you want to use Ionicons 🔗?
  3. Would you like to have full control over the icon SVGs in JSX?

Then this library is perfect for you!

📖 Table of contents

⚒️ Installation

NPM:

npm add qwik-ionicons

Yarn:

yarn add qwik-ionicons

🐣 Icon search

You need an icon? Go to:

➡️ Ionicons + Search 🔎

Pick an icon and remember its name.

An example (remember the marked name): Ionicons website, icon search

🍽️ Usage

You found an icon and have its name? Perfect! 🎉

Rewrite the name using Pascal Case. So flash-outline becomes FlashOutline.

Now you can import FlashOutline straight from the library:

import { FlashOutline } from "qwik-ionicons";

Here is an example component:

import { FlashOutline } from "qwik-ionicons";

export default component$(() => {
    return <FlashOutline width="64" data-test="flash-icon" />
})

⚙️ Props

The following attributes are typed:

  • id: string
  • class: string
  • width: string
  • height: string
  • style: { /* CSS style object */ }

All other props are passed as well! You could, for example, pass test IDs like so:

export default component$(() => {
    return <FlashOutline width="64" data-test="flash-icon" />
})

🌈 Styling

All SVGs will have the class ionicon. This allows you to define global default styles for all ionicons using CSS.

📏 Size

You can use CSS class styles or inline CSS style to set the size per Icon.

If you need a default size for all ionicons, make use of the class ionicon.

🎨 Color

All SVGs make use of the currentColor property. By default, the icons will use the same color as the current text color. To adjust an icon's color, you just need to change the text color (CSS attribute color).

For that, you can use:

  • CSS classes,
  • inline style,
  • Tailwind classes,
  • ... or whatever you like :)

🏎️ SVG/HTML footprint

The library is constructed using Qwik's component$ method.

Every single icon variant is one component.

This means:

  • You make use of Qwik's usual JS optimization feature.
  • Only the icons you use are ever imported/loaded.
  • The server pre-renders initially visible icons.

❤️ Kudos

  1. Big Kudos to the Ionic-Team for creating the awesome Ionicons collection! ❤️
  2. Thanks dear Qwik-Team for making it so simple to create a Qwik component library! ❤️

🩹 Problems?

Feel free to create a GitHub issue. Thanks for reporting any problems! ☺️

🦔 Author