Skip to main content

Masonry

shadow

The Masonry component creates a responsive "Masonry" layout of child elements that are dynamically arranged into columns based on specified attributes. Supports customizing the number of columns, maximum column width, element spacing, and debouncing to optimize performance.

Basic usage​

The sample shows the basic masonry composition without further constraints to show how the elements naturally fit into the columns.

Maximum width of columns​

Use the max-col-width attribute to limit the width of the columns to the specified value.

The Gap​

Use the gap attribute to specify the width of the gap between columns in pixels.

When to use​

Use wje-masonry to compose a stable page layout with a clear content hierarchy.

When not to use​

Do not use it to solve business logic or for stateful orchestration of components.

Accessibility​

Preserve the semantics of the document (header, main, aside, footer) and the logical order of focusable elements.

  • Define desktop/mobile breakpoints first and then fine-tune the details.
  • Prefer consistent spacing tokens over ad-hoc margin/padding values.
  • For layouts with overflow, always test keyboard navigation and readers.

Attributes and properties​

cols​

PopisNastavuje rozmery alebo veľkosť pre voľbu cols.
Atribútcols
Typnumber
Predvolené-

debounce​

PopisNastavuje číselnú hodnotu používanú vo voľbe debounce.
Atribútdebounce
Typnumber
Predvolené-

gap​

PopisNastavuje číselnú hodnotu používanú vo voľbe gap.
Atribútgap
Typnumber
Predvolené-

maxColWidth​

PopisNastavuje rozmery alebo veľkosť pre voľbu max-col-width.
Atribútmax-col-width
Typnumber
Predvolené-

Events​

Pre tento komponent nie sú dostupné žiadne udalosti.

Methods​

renderCols​

PopisVykreslí cols v používateľskom rozhraní komponentu.
Signatúra(colCount: number) => void

scheduleLayout​

PopisSpustí metódu scheduleLayout na vykonanie logiky komponentu a aktualizáciu jeho stavu.
Signatúra(ms: number) => void

CSS shadow parts​

NázovPopis
nativeŠtýluje koreňovú shadow časť komponentu.
columnŠtýluje shadow časť column.

CSS custom variables​

NázovPopis
--wje-masonry-layout-gapVlastná CSS premenná, ktorá riadi layout gap.
--wje-masonry-layout-col-countVlastná CSS premenná na štýlovanie komponentu (layout col count).

Slots​

NázovPopis
defaultPredvolený slot pre hlavný obsah komponentu.