Sloth Options

Styling

Once your images become loaded, the Sloth loader component will add a loaded class to the images parent element (which you can style off of)


Props

  • src String

    Required: true

    value of image source.

  • fadeIn Boolean

    Required: false

    set prop to true if you want image to have a transitional fade-in on load.

  • omitAspect String

    Required: false

    Use this to avoid maintaining the set or default aspect ratio of your image if you dont want to define an aspect ratio for your image with the height/width props.

  • width Number

    Required: false

    If using width, then the height prop is also required to generate an aspect ratio for the image parent.

  • height Number

    Required: false

    If using height, then the width prop is also required to generate an aspect ratio for the image parent.

  • loadWhen Number

    Required: false

    Load when is the value in which your image becomes fetched. So if using the value 0.2 then your image will begin to be fetched when it is 20% visible. You can use a value between 0 - 1.0. Leaving this blank will default to 0.5.

  • alt String

    Required: true

    Alt tag for image accessibility.