14.3.5 • Published 2 months ago

@rmwc/image-list v14.3.5

Weekly downloads
2,404
License
MIT
Repository
github
Last release
2 months ago

Image Lists

MDC Image List provides a RTL-aware Material Design image list component, representing an evolution of the Material Design Grid List spec. An Image List consists of several items, each containing an image and optionally supporting content (i.e. a text label).

Standard Layout

Image Lists will give you basic layout, but you will have to use inline styling or CSS to achieve things like spacing, aspect ratio, and column count. Check out the inline styles below as examples.

<ImageList>
  {[
    { src: 'images/photos/3x2-1.jpg', alt: 'image of building' },
    { src: 'images/photos/2x3-1.jpg', alt: 'image of wall' },
    { src: 'images/photos/3x2-4.jpg', alt: 'image of building' },
    { src: 'images/photos/3x2-5.jpg', alt: 'image of dog' },
    { src: 'images/photos/3x2-6.jpg', alt: 'image of roses' },
    { src: 'images/photos/2x3-2.jpg', alt: 'image of landscape' },
    { src: 'images/photos/3x2-8.jpg', alt: 'image of cafe' },
    { src: 'images/photos/3x2-11.jpg', alt: 'image of city' },
    { src: 'images/photos/2x3-5.jpg', alt: 'image of swing' },
    { src: 'images/photos/3x2-13.jpg', alt: 'image of oranges' },
    { src: 'images/photos/3x2-14.jpg', alt: 'image of dog' },
    { src: 'images/photos/2x3-6.jpg', alt: 'image of road' },
    { src: 'images/photos/3x2-15.jpg', alt: 'image of bus' },
    { src: 'images/photos/3x2-16.jpg', alt: 'image of cafe' },
    { src: 'images/photos/2x3-7.jpg', alt: 'image of basketball' }
  ].map((img) => (
    <ImageListItem
      key={img.src}
      style={{ margin: '2px', width: 'calc(100% / 5 - 4.2px)' }}
    >
      <ImageListImageAspectContainer
        style={{ paddingBottom: 'calc(100% / 1.5)' }}
      >
        <ImageListImage src={img.src} alt={img.alt} />
      </ImageListImageAspectContainer>
      <ImageListSupporting>
        <ImageListLabel>Text label</ImageListLabel>
      </ImageListSupporting>
    </ImageListItem>
  ))}
</ImageList>

Masonry Layout

<ImageList
  masonry
  withTextProtection
  style={{
    columnCount: 5,
    columnGap: '16px',
    maxWidth: '1000px'
  }}
>
  {[
    { src: 'images/photos/3x2-1.jpg', alt: 'image of building' },
    { src: 'images/photos/2x3-1.jpg', alt: 'image of wall' },
    { src: 'images/photos/3x2-4.jpg', alt: 'image of building' },
    { src: 'images/photos/3x2-5.jpg', alt: 'image of dog' },
    { src: 'images/photos/2x3-5.jpg', alt: 'image of swing' },
    { src: 'images/photos/3x2-6.jpg', alt: 'image of roses' },
    { src: 'images/photos/2x3-2.jpg', alt: 'image of landscape' },
    { src: 'images/photos/3x2-8.jpg', alt: 'image of cafe' },
    { src: 'images/photos/3x2-11.jpg', alt: 'image of city' },
    { src: 'images/photos/3x2-13.jpg', alt: 'image of oranges' },
    { src: 'images/photos/3x2-14.jpg', alt: 'image of dog' },
    { src: 'images/photos/2x3-6.jpg', alt: 'image of road' },
    { src: 'images/photos/3x2-15.jpg', alt: 'image of bus' },
    { src: 'images/photos/2x3-7.jpg', alt: 'image of basketball' },
    { src: 'images/photos/3x2-16.jpg', alt: 'image of cafe' }
  ].map((img) => (
    <ImageListItem key={img.src} style={{ marginBottom: '16px' }}>
      <ImageListImage src={img.src} alt={img.alt} />
      <ImageListSupporting>
        <ImageListLabel>Text label</ImageListLabel>
      </ImageListSupporting>
    </ImageListItem>
  ))}
</ImageList>

ImageList

The root of the Image List.

Props

NameTypeDescription
masonrybooleanIndicates that this Image List should use the Masonry variant.
withTextProtectionbooleanIndicates that supporting content should be positioned in a scrim overlaying each image (instead of positioned separately under each image).

ImageListItem

Indicates each item in an Image List.

ImageListImageAspectContainer

Optional. Parent of each item’s image element, responsible for constraining aspect ratio. This element may be omitted entirely if images are already sized to the correct aspect ratio.

ImageListImage

Indicates the image element in each item.

ImageListSupporting

Optional. Indicates the area within each item containing the supporting text label, if the Image List contains text labels.

ImageListLabel

Optional. Indicates the text label in each item, if the Image List contains text labels.

14.3.5

2 months ago

14.3.4

3 months ago

14.3.3

4 months ago

14.2.7

6 months ago

14.2.8

6 months ago

14.2.9

6 months ago

14.2.5

6 months ago

14.2.6

6 months ago

14.3.0

5 months ago

14.3.1

5 months ago

14.3.2

4 months ago

14.2.2

8 months ago

14.2.0

8 months ago

14.2.1

8 months ago

14.1.5

8 months ago

14.1.4

9 months ago

14.1.3

9 months ago

14.1.2

9 months ago

14.1.1

10 months ago

14.1.0

10 months ago

14.0.12

10 months ago

14.0.11

10 months ago

14.0.10

10 months ago

14.0.9

11 months ago

14.0.8

11 months ago

14.0.7

11 months ago

14.0.6

12 months ago

14.0.5

12 months ago

14.0.4

1 year ago

14.0.1-alpha.0

1 year ago

14.0.2-alpha.3

1 year ago

14.0.2-alpha.0

1 year ago

14.0.2-alpha.1

1 year ago

14.0.2-alpha.6

1 year ago

14.0.2-alpha.7

1 year ago

14.0.2-alpha.4

1 year ago

14.0.2-alpha.5

1 year ago

14.0.0

1 year ago

14.0.1

1 year ago

14.0.0-alpha.0

1 year ago

14.0.2

1 year ago

14.0.3

1 year ago

8.0.8

2 years ago

8.0.7

2 years ago

8.0.6

2 years ago

8.0.5

2 years ago

8.0.4

2 years ago

8.0.3

2 years ago

8.0.2

2 years ago

8.0.1

2 years ago

8.0.0

3 years ago

7.0.3

3 years ago

7.0.2

3 years ago

7.0.1

3 years ago

7.0.0

3 years ago

6.1.4

4 years ago

6.0.14

5 years ago

6.0.13

5 years ago

6.0.12

5 years ago

6.0.11

5 years ago

6.0.10

5 years ago

6.0.9

5 years ago

6.0.5

5 years ago

6.0.4

5 years ago

6.0.1

5 years ago

6.0.0

5 years ago

6.0.3

5 years ago

6.0.2

5 years ago

6.0.0-rc.4

5 years ago

6.0.0-rc.3

5 years ago

6.0.0-rc.2

5 years ago

6.0.0-rc.1

5 years ago

6.0.0-rc.0

5 years ago

6.0.0-alpha.16

5 years ago

6.0.0-alpha.14

5 years ago

6.0.0-alpha.15

5 years ago

6.0.0-alpha.13

5 years ago

6.0.0-alpha.12

5 years ago

6.0.0-alpha.11

5 years ago

6.0.0-alpha.7

5 years ago

5.7.2

5 years ago

6.0.0-alpha.6

5 years ago

6.0.0-alpha.4

5 years ago

6.0.0-alpha.5

5 years ago

6.0.0-alpha.3

5 years ago

6.0.0-alpha.1

5 years ago

5.7.0

5 years ago

5.6.0

5 years ago

5.5.2

6 years ago

5.5.1

6 years ago

5.5.0

6 years ago

5.4.3

6 years ago

5.4.2

6 years ago

5.4.1

6 years ago

5.4.0

6 years ago

5.3.1

6 years ago

5.3.0

6 years ago

5.2.2

6 years ago

5.2.1

6 years ago

5.2.0

6 years ago

5.2.0-alpha.0

6 years ago

5.1.8

6 years ago

5.1.7

6 years ago

5.1.6

6 years ago

5.1.5

6 years ago

5.1.4

6 years ago

5.1.3

6 years ago

5.1.2

6 years ago

5.1.1

6 years ago

5.1.0

6 years ago

5.0.30-rc.0

6 years ago

5.0.29-rc.0

6 years ago

5.0.28-rc.0

6 years ago

5.0.27-rc.0

6 years ago

5.0.26-rc.0

6 years ago

5.0.25-rc.0

6 years ago

5.0.24-rc.0

6 years ago

5.0.23-rc.0

6 years ago

5.0.23-alpha.0

6 years ago

5.0.22-alpha.0

6 years ago

5.0.21-alpha.0

6 years ago

5.0.20-alpha.0

6 years ago

5.0.19-alpha.0

6 years ago

5.0.18-alpha.0

6 years ago

5.0.17-alpha.0

6 years ago

5.0.16-alpha.0

6 years ago

5.0.15-alpha.0

6 years ago

5.0.14-alpha.0

6 years ago

5.0.13-alpha.0

6 years ago

5.0.12-alpha.0

6 years ago

5.0.8-alpha.0

6 years ago

5.0.7-alpha.0

6 years ago

5.0.6-alpha.0

6 years ago

5.0.5-alpha.0

6 years ago

5.0.4-alpha.0

6 years ago

5.0.3-alpha.0

6 years ago

5.0.2-alpha.0

6 years ago

5.0.1-alpha.0

6 years ago

5.0.0-alpha.0

6 years ago

4.0.6

6 years ago

4.0.5

6 years ago

4.0.4

6 years ago

4.0.1

6 years ago

4.0.0

6 years ago

3.0.11

6 years ago

3.0.10

6 years ago

3.0.9

6 years ago

3.0.8

6 years ago

3.0.7

6 years ago

3.0.6

6 years ago

3.0.5

6 years ago

3.0.4

6 years ago

3.0.0

6 years ago

2.2.0

6 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.0

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

2.0.0-alpha.7

6 years ago

2.0.0-alpha.6

6 years ago

2.0.0-alpha.5

6 years ago

2.0.0-alpha.4

6 years ago

2.0.0-alpha.3

6 years ago

2.0.0-alpha.2

6 years ago

2.0.0-alpha.1

6 years ago

2.0.0-alpha.0

6 years ago

1.10.1-alpha.0

6 years ago

1.10.0-alpha.0

6 years ago