1.0.0 • Published 4 years ago

shapla-image-container v1.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

shapla-image-container

The image container to specify a precisely sized container so that your layout isn't broken because of image loading or image errors.

Table of contents

Installation

npm i shapla-image-container

Usage

Add the component:

import imageContainer from 'shapla-image-container';

export default {
  name: 'Hello',

  components: {
    imageContainer
  },
}
<image-container container-width="32px" container-height="32px" is-rounded>
    <img src="https://via.placeholder.com/48x48">
</image-container>

<image-container :width-ratio="3" :height-ratio="4">
    <img src="https://via.placeholder.com/420x560">
</image-container>

<image-container :width-ratio="16" :height-ratio="9">
    <iframe width="640" height="360" src="https://www.youtube.com/embed/YE7VzlLtp-4?showinfo=0"
        frameborder="0" allowfullscreen></iframe>
</image-container>

Props

PropertyTypeRequiredDefaultDescription
heightRatioNumberno1Image height ratio. You can also put image height
widthRatioNumberno1Image width ratio. You can also put image width
containerWidthStringno | Width of the container.
containerHeightStringno | Height of the container.
isRoundedBooleannofalseIf set true, inside item will be rounded