Layouts

All six widget layout types and their configuration options.

Vizco supports six layout types, each with its own configuration data class. The layout is set when creating or updating a widget via the API.

A horizontally paged image carousel with optional autoplay, dots indicator, and navigation arrows.

NameTypeDefaultDescription
autoplayBooleanfalseAutomatically advance pages
autoplay_speedLong3000Autoplay interval in milliseconds
show_arrowsBooleantrueShow left/right navigation arrows
show_dotsBooleantrueShow page indicator dots
infiniteBooleantrueLoop back to the first image after the last
transitionStringslideTransition type: slide or fade
aspect_ratioFloat?nullFixed aspect ratio (e.g. 1.78 for 16:9). Null uses image dimensions.
Example config
{
"autoplay": true,
"autoplay_speed": 4000,
"show_dots": true,
"infinite": true,
"transition": "slide"
}

Grid

A fixed-column grid layout with configurable gap and aspect ratio.

NameTypeDefaultDescription
columnsInt2Number of columns
gapInt8Gap between items in DP
aspect_ratioFloat?nullFixed aspect ratio for all items
object_fitStringcoverHow images fit: cover, contain, or fill
Example config
{
"columns": 3,
"gap": 12,
"aspect_ratio": 1.0,
"object_fit": "cover"
}

Masonry

A staggered grid layout where each item preserves its natural aspect ratio, creating a Pinterest-style layout.

NameTypeDefaultDescription
columnsInt2Number of columns
gapInt8Gap between items in DP
Example config
{
"columns": 2,
"gap": 8
}

Slider

A full-width single-image slider with optional counter overlay and navigation arrows. Similar to carousel but shows one image at a time with a counter instead of dots.

NameTypeDefaultDescription
autoplayBooleanfalseAutomatically advance slides
autoplay_speedLong3000Autoplay interval in milliseconds
show_arrowsBooleantrueShow navigation arrows
show_counterBooleanfalseShow slide counter (e.g. 1/5)
transitionStringslideTransition type: slide or fade
aspect_ratioFloat?nullFixed aspect ratio
Example config
{
"autoplay": true,
"show_counter": true,
"transition": "fade"
}

List Vertical

A vertically scrolling list of images with optional captions.

NameTypeDefaultDescription
gapInt8Gap between items in DP
show_captionBooleanfalseShow image filename as caption
max_widthInt?nullMaximum width constraint in DP
Example config
{
"gap": 16,
"show_caption": true,
"max_width": 600
}

List Horizontal

A horizontally scrolling list of images with configurable item width and optional scroll snapping.

NameTypeDefaultDescription
gapInt8Gap between items in DP
item_widthInt?nullFixed item width in DP. Null defaults to 160dp.
scroll_snapBooleanfalseSnap to item boundaries when scrolling
Example config
{
"gap": 12,
"item_width": 200,
"scroll_snap": true
}

Setting the layout via API

The layout and config are set when creating or updating a widget:

Create widget request
{
"name": "Product Gallery",
"slug": "product-gallery",
"assetIds": ["550e8400-...", "660e8400-..."],
"layout": "MASONRY",
"config": {
  "columns": 3,
  "gap": 8
}
}

Valid layout values: CAROUSEL, GRID, MASONRY, SLIDER, LIST_VERTICAL, LIST_HORIZONTAL.