2.0.0 • Published 6 years ago

@amctheatres/reacticon v2.0.0

Weekly downloads
21
License
ISC
Repository
bitbucket
Last release
6 years ago

Reacticon

A React-compatible implementation of Grunticon. It still requires Grunticon to generate the output files; this just replaces the runtime piece, grunticon.loader.js.

Why?

The SVG embedding component of Grunticon directly manipulates the DOM. Thus, it does not play well with React as component rerenders would wipe the SVG elements out.

Installation

npm install --save @amctheatres/reacticon

Usage

import Icon from '@amctheatres/reacticon';
import React from 'react';

Icon.initialize(
    '/path/to/icons.data.svg.css',
    '/path/to/icons.data.png.css',
    '/path/to/icons.fallback.css'
);

export default class SampleComponent extends React.Component {
    render() {
        return (
            <div>
                <p>Look, it's a reacticon!</p>
                <Icon className="icon_yourIcon" />
            </div>
        );
    }
}

Additional Information

By default, an tag will be created. You may override this by passing a tagName property (tagName="div"). Or, if you would like to set the tag type for ALL icons so they use it by default, you may pass it as a fourth parameter to the initialize function.

Note that the data-grunticon-embed attribute normally required by Grunticon is not required as that functionality is implicitly assumed by using this component.

2.0.0

6 years ago

2.0.0-alpha.1

6 years ago

2.0.0-alpha.0

6 years ago

1.2.0

6 years ago

1.1.3

6 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

8 years ago

1.0.4

8 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.1

9 years ago