egoist / vue-content-loader

SVG component to create placeholder loading, like Facebook cards loading.

Home Page:https://create-content-loader.now.sh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong height

leolux opened this issue · comments

The height of the rendered component is higher than the height set with :height="200"

Experiencing the same.
Setting the height to same size of window window.innerHeight

This was an issue for me when the loader was too wide for the parent container

width and height props are used to set the SVG viewBox ratio, it does not hard code the dimensions on the element currently. I think in some cases it might be great to have different values.

My suggestion would be to get closer to what react-content-loader does:

  • Keep width and height props but without default values, apply them as width and height attributes on the root SVG element if not empty
  • Add a viewBox prop to be applied on the root SVG element, defaults to 0 0 {width} {height} like it is now (if no width or height is specified, use 400✗130).

🎉 This issue has been resolved in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀