Giter Club home page Giter Club logo

icons's Introduction

React Icons

The icon components for Geist UI.

npm Version Build

Install

$ yarn add @geist-ui/icons
OR
$ npm install @geist-ui/icons

Usage

import React from 'react'
import { Code } from '@geist-ui/icons'

const App = () => {
  return <Code />
}

export default App

Icons can be configured with color, size and any SVG props:

<Code color="red" size={36} />
<Code color="blue" strokeWidth={2} />

Other ways

  1. You can include the whole icon pack:
import * as Icons from '@geist-ui/icons'

const App = () => {
  return <Icons.Code />
}
  1. You can include single icon:
import Code from '@geist-ui/icons/code'

const App = () => {
  return <Code />
}

LICENSE

MIT

icons's People

Contributors

dependabot[bot] avatar em2046 avatar junhoyeo avatar ofekashery avatar sevenoutman avatar unix avatar

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  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

icons's Issues

Icons do not support SVG props in typescript

the code from makeBasicDefinition:

interface Props extends React.SVGProps

Maybe it will work

interface Props extends React.SVGProps<SVGSVGElement>

And, the GitHub component should be renamed as Github in README.md, a spelling mistake

PnP Support

Hey, man, I really like icons like `@geist-ui/react-icon'. But it doesn't seem to support the PNP of Yarn 2.

A document site for query icons

We may need a site to query and search all icons, let everyone use the icon by clicking and copying.

Refer to vue-icons

We can use @zeit-ui/react to build this single page site.

Remove peer dependency `@geist-ui/core`

Could we remove the peer dependency @geist-ui/core? It seems this package doesn't reply on the core, but PNPM always complains it as I don't use the @geist-ui/core
image

Remove `dist` path from published package

  1. When the user needs to import a single icon:
// better
import Activity from '@zeit-ui/react-icons/activity'

// now
import Activity from '@zeit-ui/react-icons/dist/activity'
  1. When import all icons, we also need to change the default export name:
// better
import { HomeIcon } from '@zeit-ui/react-icons'

// now
import { Home } from '@zeit-ui/react-icons'

It doesn't look good to add suffixes here, however, use import { Home as HomeIcon } grammar is more annoying. In many projects using material-ui, you can often see a lot of code similar to Home as HomeIcon.

Cache icon source for stability

Cache icon source to ensure the same content is published each time, avoid unnecessary errors caused by source updates.

The best solution is that we always update the source manually after source updated.

@ofekashery What's your opinion?

// update source
const res = await fetch('https://vercel.com/design/icons')
const html = await res.text()
writeToSource(html)

// generate
const cacheSource(getSource(path))
const document = new JSDOM(cacheSource).window.document

Merge utility functions when export all icons

Within each icon component, the following codes is generated (42 / 68 - 61%):

function _extends() { ... }

function _objectWithoutProperties() { ... }

function _objectWithoutPropertiesLoose() { ... }

If we generate an index.bundle.js file, the volume maybe only half of the original.

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.