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

@swc-ui/icons

v0.1.6

Published

Stencil Component Starter

Downloads

6

Readme

Web Component 图标库

@swc-ui/components Web Component 组件库封装的图标库

安装

选择一个你喜欢的包管理器安装

# NPM
$ npm install @swc-ui/icons

# Yarn
$ yarn add @swc-ui/icons

# pnpm
$ pnpm install @swc-ui/icons

注册使用

1、批量一次性引入所有图标注册

// 全量引入
import { defineCustomElements} from '@swc-ui/icons/loader'
defineCustomElements()

2、按需引入图标注册【推荐】

// 按需引入,自动注册
import '@swc-ui/icons/dist/components/swc-icon-add-location.js'

像普通 html 标签一样使用

<swc-icon-add-location></swc-icon-add-location>

3、所有 icon 名称

import { icons } from '@swc-ui/icons'

基础用法

通过设置 name 来使用其他图标

<!-- 使用 swc-icon 为 SVG 图标提供属性 -->
<swc-icon name="edit" color="red"></swc-icon>

<!-- 或者独立使用它,不从父级获取属性 -->
<swc-icon-edit></swc-icon-edit>

倾斜 rotate

通过rotate倾斜 icon 角度

<swc-icon name="edit" rotate="30"></swc-icon>
<swc-icon name="reading" rotate="60"></swc-icon>

旋转

添加spin属性来使 icon 旋转

<swc-icon name="loading" spin></swc-icon>
<swc-icon name="refresh-right" spin></swc-icon>
<swc-icon name="refresh" spin></swc-icon>

大小

添加size属性来设置大小

<swc-icon name="loading" size="16"></swc-icon>
<swc-icon name="loading"></swc-icon>
<swc-icon name="loading" size="24"></swc-icon>
<swc-icon name="loading" size="30"></swc-icon>
<swc-icon name="loading" size="36"></swc-icon>

颜色

添加color属性来设置颜色

<swc-icon name="loading"></swc-icon>
<swc-icon name="loading" color="red"></swc-icon>
<swc-icon name="loading" color="blue"></swc-icon>
<swc-icon name="loading" color="pink"></swc-icon>
<swc-icon name="loading" color="green"></swc-icon>

Attrs

| 属性名 | 说明 |类型| 可选值 | 默认值 | |-------|------|-|-----------|--------| | name | 图标名称 |string| @swc-ui/icons 图标 | - | | rotate | 图标旋转角度 |number| 0 | - | | spin | 360度旋转 |boolean| truefalse | false | | size | 图标大小 |string| 合法的 css 单位 | 1em | | color | 图标颜色 |string| 合法的颜色值 | - |