Git Product home page Git Product logo

icons's Introduction

@hackclub/icons

Hack Club’s icons are a superset of Spectrum’s incredible collection (also published as spectrum-icons). Designed for use with our Design System.

See them all

Usage

With React

npm i @hackclub/icons
import React from 'react'
import Icon from '@hackclub/icons'

export default () => (
  <div style={{ color: 'cyan' }}>
    <Icon glyph="clubs" size={128} />
    <Icon glyph="bank-circle" size={64} />
    <Icon glyph="leaders" size={32} />
  </div>
)

With the API

https://icons.hackclub.com/api/icons/:color/:glyph

  • :glyph - A glyph from icons.hackclub.com.
  • :color - Any valid HTML color or Hack Club Theme color prefixed with hackclub-. Replace # with 0x when using a hexadecimal color.

All responses are SVGs with the MIME type image/svg+xml. You can optionally include the .svg file extension.

Examples:

<img src="https://icons.hackclub.com/api/icons/red/clubs">
<img src="https://icons.hackclub.com/api/icons/hackclub-green/battery-bolt">
<img src="https://icons.hackclub.com/api/icons/0xc78ad4/sam.svg">

In Figma

Copy and paste the Hack Club Icon component from the Figma file: figma.com/file/u8evOObGA4HCzUKlrVra1q/Hack-Club-Icon-Component

Choose the icon you'd like by modifying the Glyph.

Development Setup

  1. Clone & enter the repo.
$ git clone https://github.com/hackclub/icons.git
$ cd icons
  1. Install dependencies.
$ yarn
  1. Build library.
yarn run prepare
  1. Run docs locally.
yarn run dev

Adding an icon

If you’d like to add an icon, the Figma file is Hack Club Icons. Try to design the icon only out of components of other icons, to keep consistency high, with those small square canvas sizes. When you’re done, clone your new icon, flatten all the layers into one shape for the simplest/smallest code/rendering, then export as an SVG with no background. Open the file, copy the <path>, then in the Icon source file, add a new one (alphabetically), using a wrapping <g> if you have several <path>s. Make sure to remove the fill attribute from all paths, & ensure you’re formatting props correctly as JSX (replacing hyphens with camelCase).

After publishing, remember to update the package dependency on the docs site so it’s showing the latest iconset.

icons's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

icons's Issues

Icons API maintaining separate list of icons

It would be better to combine the two lists into one source file. If the React/Next.js API allows for rendering icons to HTML, then that might be a way of merging the two lists.

[FR] Add copy to clipboard of SVG code from website

It would be very nice to be able to copy the inline SVG of each icon directly from the website using inspect. This is useful because I could paste icons right into figma, as well as into my HTML source.

Thank you!

--reese

Add folder icon

An "add folder" icon would be very helpful (to go along with add and delete buttons)

Add mention of icons CDN to readme?

A while back I made https://icons.dino.icu, which acts as a CDN for icons in projects that don't use React.

I could add some documentation, but the request format is pretty straightforward:

https://icons.dino.icu/icons/color:<Color>/glyph:<GlyphName>.svg

The color must be a valid SVG/HTML5 color, and the glyph must be one from the website. For example, https://icons.dino.icu/icons/color:red/glyph:clubs.svg.

icons.dino.icu/icons/color:red/glyph:clubs.svg

I think it might be helpful to add a mention of the CDN to the README for future users of the Hack Club iconset. If it sounds like an interesting feature, we can add it to the README or maybe integrate it into the site itself.

Android icon bug

    @cytronicoder there seem to be issues with the android icon (rainbow worked perfectly). Could you take a look at it on the website?

Originally posted by @sampoder in #40 (comment)

Link to supercons

Spectrum-icons is no longer maintained and now manifests itself as Supercons - I think the homepage should reflect this

Warning icon

Y'all should add a warning icon similar to the one in HCB for danger mode.
image

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.