ImageGroup handbook
v1.1.2 · @snowui-design-system/components
License: Before first reading component documentation, source code, or npm usage instructions, read the complete LICENSE. One review covers the same task and version. Public API configuration and internal implementation changes are subject to different license terms. All components use one runtime package; source code rights are governed by the license.
Overview
Give multiple images a shared size and layout, with group previews for galleries, attachments, and image collections.
When to use it
Use ImageGroup to organize images under shared settings. Pair it with ImageViewer for full-screen viewing, zoom, or group navigation; express layout and loading state through public APIs.
Choose the group layout with
layoutand share image dimensions withsize.Image children join the media group automatically. Explicit child
sizeorpreviewModeoverrides the group default.
Quick start
This example shows the recommended basic composition. See the following sections for more scenarios and composition limits.
API
See the base component documentation for inherited capabilities not redeclared here. This table lists only the named public props declared in this component’s source.
Usage boundaries and details
Layout model
Main layout model: managed composite layout.
The regional structure of ImageGroup is group root / media item collection / preview registration.
Image children retain intrinsic atomic layout. ImageGroup manages only row/column/grid arrangement, shared size context, and Viewer registration.
previewModeis a collection preview strategy that does not change the internal layout model of the sub-item Image.ImageGroup does not embed ImageViewer. A separate page-level Viewer consumes its registered group list.
User-facing features
Share image size within the group.
Support
row/column/gridlayouts.Use a fixed default gap of 4px.
Provide a multi-image preview index to a page-level ImageViewer.
Collect child Image media automatically for the page-level Viewer.
2. Visual rules
All three layouts (
row,column, andgrid) use a fixed 4px gap (var(--gap-1)); nogapprop is exposed.stackis not supported; layouts are limited to linear and grid arrangements.Images inherit group
sizeby default; an explicit childsizetakes precedence.griddefaults to two columns so it does not appear as a single row without another column definition.Each child Image registers its
srcandaltfor the page’s single ImageViewer to open and navigate.At Viewer opening, pass the group-list snapshot by stable reference without copying the array again.
The group media registry uses in-place
push/spliceto reduce short-lived allocations during mount and unmount.previewModeis passed down as the default for child Images; an explicit child setting takes priority. If both omit it, join a shared page Viewer when available, otherwise fall back towindow.
3. Examples
ImageGroup does not expose a
gapprop; spacing is fixed at 4px.If gallery selection is added later, keep group-provided shared sizing as the primary path.
ImageGroup does not embed ImageViewer. With one automatic Viewer at the page root, groups without explicit
previewModeshare it.
ImageGroup style overlay
Read the complete LICENSE first; one review covers the same task, version, and scope.
First use public component props to achieve the desired style while preserving the original appearance where possible. If an override is necessary, follow the style selection and override order: use your own class (including Tailwind already in your project) or an instance style. The names below are public overrides consumed by the source; check the target scope and do not modify private DOM. Choose the appropriate SnowUI token category. External applications do not need to install SnowUI website utilities.
ImageGroup type and status
Required props: no named required props.
Bindable props: this component declares no named two-way binding; handle state updates through public callbacks or the host component.
Inheritance: Omit<FrameProps, "gap">. Consult the public Frame documentation; omitted fields cannot be passed through unchanged.
Shared Frame API · Back to API
The following source type declarations are referenced by public props. Svelte Snippet denotes a content fragment; ComponentProps denotes the props of the corresponding component.
ImageGroupSize
Source: components/src/components/ImageGroup.svelte
ResourceSize
Source: components/src/context.ts
ImageGroupLayout
Source: components/src/components/ImageGroup.svelte
PreviewMode
Source: components/src/logic/image-preview.ts