1. Domino UI
  2. Components
  3. Thumbnails
Top Basic Alignment Content Title Detailed Docs

Thumbnails

A component that represents a thumbnail, often used to display condensed content. It provides a way to display a small representation of an extended card or media object. It's flexible enough to be used in both image and non-image content.

Usage Example:

 
 Thumbnail thumbnail = Thumbnail.create()
    .appendChild(someImageElement)
    .withTitle(titleHandler)
    .withBody(bodyHandler);
 

See also :

Examples

Basic thumbnail Simple display images.

Thumbnails content Add custom contents to the thumbnail.

Thumbnail title Thumbnails can have titles.

Detailed thumbnails Thumbnails can be customized with detailed content

API Docs: Thumbnail

Constructors

public void Thumbnail()
Initializes the Thumbnail component with default structure and styles.

Static methods

public static Thumbnail create()
Factory method to create a new Thumbnail instance.

Returns:

a new Thumbnail instance.

Public methods

public HTMLElement getAppendTarget()
Returns the HTMLElement where new child elements should be appended.

Returns:

the main body HTMLElement of the thumbnail.

public Thumbnail setDirection(ThumbnailDirection direction)
Sets the visual direction of the thumbnail.

direction

the direction the thumbnail should take. This affects its visual appearance.



Returns:

the current Thumbnail instance for method chaining.

public Thumbnail appendChild(HTMLImageElement img)
Appends an image to the thumbnail and applies the necessary styling.

img

the image element to be appended.



Returns:

the current Thumbnail instance for method chaining.

public Thumbnail appendChild(IsElement<?> element)
Appends a child element to the thumbnail. If the child is an image or picture, it applies the necessary styling.

element

the element to be appended.



Returns:

the current Thumbnail instance for method chaining.

public Thumbnail appendChild(Node node)
Appends a child node to the thumbnail. If the node is an image or picture, it applies the necessary styling.

node

the node to be appended.



Returns:

the current Thumbnail instance for method chaining.

public HTMLDivElement element()
Returns the main div element representing the thumbnail.

Returns:

the main HTMLDivElement of the thumbnail.

public Thumbnail withHeader(ChildHandler<Thumbnail, DivElement> handler)
Applies the provided handler to the header of the thumbnail.

handler

the handler that will be applied to the thumbnail header.



Returns:

the current Thumbnail instance for method chaining.

public Thumbnail withTitle(ChildHandler<Thumbnail, DivElement> handler)
Applies the provided handler to the title of the thumbnail.

handler

the handler that will be applied to the thumbnail title.



Returns:

the current Thumbnail instance for method chaining.

public Thumbnail withTitle()
Ensures the title element is initialized.

Returns:

the current Thumbnail instance for method chaining.

public Thumbnail withTail(ChildHandler<Thumbnail, DivElement> handler)
Applies the provided handler to the tail of the thumbnail.

handler

the handler that will be applied to the thumbnail tail.



Returns:

the current Thumbnail instance for method chaining.

public Thumbnail withTail()
Ensures the tail element is initialized.

Returns:

the current Thumbnail instance for method chaining.

public Thumbnail appendChild(FooterContent<?> footerContent)
Appends the provided footer content to the footer of the thumbnail.

footerContent

the footer content to be appended.



Returns:

the current Thumbnail instance for method chaining.

public Thumbnail appendChild(HeaderContent<?> headerContent)
Appends the provided header content to the title of the thumbnail.

headerContent

the header content to be appended.



Returns:

the current Thumbnail instance for method chaining.

public Thumbnail withFooter(ChildHandler<Thumbnail, DivElement> handler)
Applies the provided handler to the footer of the thumbnail.

handler

the handler that will be applied to the thumbnail footer.



Returns:

the current Thumbnail instance for method chaining.

public Thumbnail withFooter()
Ensures the footer element is initialized.

Returns:

the current Thumbnail instance for method chaining.

public Thumbnail withBody(ChildHandler<Thumbnail, DivElement> handler)
Applies the provided handler to the body of the thumbnail.

handler

the handler that will be applied to the thumbnail body.



Returns:

the current Thumbnail instance for method chaining.

public DivElement getHeader()
Returns the header div element of the thumbnail.

Returns:

the header div element.

public DivElement getTitle()
Returns the title div element of the thumbnail.

Returns:

the title div element.

public DivElement getBody()
Returns the body div element of the thumbnail.

Returns:

the body div element.

public DivElement getTail()
Returns the tail div element of the thumbnail.

Returns:

the tail div element.

public DivElement getFooter()
Returns the footer div element of the thumbnail.

Returns:

the footer div element.

We are a group of passionate people who love what we do

Donate & Support Us