Skip to content

afeiship/react-font-icon

Repository files navigation

react-font-icon

Ali font icon for react.

version license size download

installation

npm install -S @jswork/react-font-icon

usage

  1. import css
@import "~@jswork/react-font-icon/dist/style.css";

// or use sass
@import "~@jswork/react-font-icon/dist/style.scss";
  1. setup / set defaults
import ReactFontIcon from '@jswork/react-font-icon';

ReactFontIcon.defaultProps = {
  ...ReactFontIcon.defaultProps,
  prefix: 'ai7icon-',
};
  1. import js
import ReactFontIcon from '@jswork/react-font-icon';
import './setup.ts';
import '@jswork/react-font-icon/dist/style.scss';

function App() {
  return (
    <div className="m-10 p-4 shadow bg-gray-100 text-gray-800 hover:shadow-md transition-all">
      <div className="badge badge-warning absolute right-0 top-0 m-4">
        Build Time: {BUILD_TIME}
      </div>
      <div className="text-center space-x-2">
        <ReactFontIcon name="a-custompersonbubble" size={20} />
        <ReactFontIcon name="a-custompersonbubble" size={24} />
        <ReactFontIcon name="a-custompersonbubble" size={28} />
        <ReactFontIcon name="a-custompersonbubble" size={50} />
      </div>
    </div>
  );
}

export default App;

preview

license

Code released under the MIT license.