<img-gallery/>

Our Image Gallery Component is a simple gallery with a masonry style grid(e.g Pinterest Grid Style). It is designed to lessen the time you spend on css just to get a good looking gallery. It is fully responsive. Get a feel of it below. Click on an image to enter View Mode.

Using this component

Script Tag

Node Modules


Usage Example

Please do not use both methods shown below together. i.e dont combine the two. If combined the component will default to the 2nd method.
  1. Place your images as direct children of the component. It is important that the images are direct children. Do not place them in a container such as a div or section etc.

     
    < img-gallery >
         < img src = "example1.jpg" >
         < img src = "example2.jpg" >
         < img src = "example3.jpg" >
         < img src = "example4.jpg" >
         < img src = "example5.jpg" >
    </ img-gallery >
     
     
  2. Feed an array of image source urls to the src property. Please note that this is for use within frameworks such as Angular, Ionic Framework, Stencil, React etc.

    In your .ts file

     
    URLArray: Array<string> = [ 'example1.jpg' , 'example2.jpg' , 'example2.jpg' , 'example2.jpg' ];
     
     

    In your .html file

     
    < img-gallery src={URLArray}></ img-gallery >
     
     

    Or in your tsx file

     
    URLArray: Array< string > = ['example1.jpg','example2.jpg','example2.jpg','example2.jpg'];
     
    render() {
         return(
             < div >
                 < img-gallery src={this.URLArray}></ img-gallery >
             </ div >
         )
    };
     
     

Component Properties

Image Gallery Component only takes two optional properties.

  1. src property discussed above.

  2. color property.

    This is the background color of the Gallery. If not supplied the Gallery will inherit the background color of the page,div or section that it is placed in. It can either be a valid css color name or a valid css hex color code.

     
    < img-gallery color = "black" >
         ...
    </ img-gallery >
     
    <!-- or -->
     
    < img-gallery color = "#000" >
         ...
    </ img-gallery >