/svg-loaders-react

React implementation of the SVG Loaders library by Sam Herbert

Primary LanguageJavaScriptOtherNOASSERTION

This is a React adaptation of Sam Herberts SVG Loaders library.

Usage

Importing the SVGLoaders components

Import all the loaders in a namespaced fashion

You can import all the loaders at once:

import * as SVGLoaders from 'svg-loaders-react';

and use them in a namespaced manner:

<SVGLoaders.Bars />

Import an individual loader

You can also import a single loader:

import { Bars } from 'svg-loaders-react'

and use it without any fancy namespacing:

<Bars />

Components

<Audio />

<BallTriangle />

<Bars />

<Circles />

<Grid />

<Hearts />

<Oval />

<Puff />

<Rings />

<SpinningCircles />

<TailSpin />

<ThreeDots />

Options

Each of these components wraps an SVGInline component. You can pass any options to the loader components that you can an SVGInline component. The options are:

className
classSuffix
component
fill
cleanup
cleanupExceptions
width
height
accessibilityLabel
accessibilityDesc

For a complete description of each option, please see the react-svg-inline docs.