Class Gallery

All Implemented Interfaces:
Component

public class Gallery extends Grid
Grid-based image gallery component.

Mutable and not thread-safe through inherited grid/item mutation state. For reuse, stop mutating shared instances and render stable structures with per-request context data.

  • Constructor Details

    • Gallery

      public Gallery()
  • Method Details

    • create

      public static Gallery create()
    • withColumns

      public Gallery withColumns(int columns)
      Description copied from class: Grid
      Sets column count and rewrites derived classes.
      Overrides:
      withColumns in class Grid
      Parameters:
      columns - number of columns used in grid-cols-<n>
      Returns:
      this grid
    • addImage

      public Gallery addImage(String src, String alt)
      Adds an image with an application-controlled or separately image-context-validated source.
    • addImage

      public Gallery addImage(String src, String alt, String caption)
      Adds an encoded source and escaped caption, without Image's source policy. Supply an application-controlled or separately image-context-validated URL; payloads are not inspected.
    • withClass

      public Gallery withClass(String className)
      Description copied from class: HtmlTag
      Overrides:
      withClass in class HtmlTag