Skip to main content

Hairball



  // import { Hairball, HairballPreset } from 'react-loader-spinner/dist/beta';

    render(
      <Hairball
      preset="dawn" // or preset={HairballPreset.sunset}
      />
    )



More Example:

Here are some more examples of the Hairball component using different presets. It is recommended that you use the presets, as they are designed to work well with the Hairball component. However, you can also pass your own colors to the Hairball component. See the colors props section for more information.


Props

Props

Loading prop definitions…

Presets

The following presets are available:

PresetColorsName
sunset
preset={HairballPreset.sunset}
ocean
preset={HairballPreset.ocean}
forest
preset={HairballPreset.forest}
twilight
preset={HairballPreset.twilight}
dawn
preset={HairballPreset.dawn}
dusk
preset={HairballPreset.dusk}
midday
preset={HairballPreset.midday}
midnight
preset={HairballPreset.midnight}
sunrise
preset={HairballPreset.sunrise}
rainbow
preset={HairballPreset.rainbow}

Each preset corresponds to a unique color schema. You can use these presets to easily change the color scheme of the Hairball component. Simply pass the name of the preset to the preset prop of the Hairball component, like this: <Hairball preset={HairballPreset.sunset} />.


Custom Colors

You can also pass your own colors to the Hairball component. To do this, pass an object to the colors prop of the Hairball component, like this:

<Hairball
colors={{
fillColor1: '#ff0000',
fillColor2: '#00ff00',
fillColor3: '#0000ff',
fillColor4: '#ffff00'
}}
/>

The colors prop takes an object with the following properties:

  • fillColor1 - The color of the first fill.
  • fillColor2 - The color of the second fill.
  • fillColor3 - The color of the third fill.
  • fillColor4 - The color of the fourth fill.