Skip to main content

Card Grid

Rocket 2.0

The Card Grid component shows a list of records as cards in a grid, each built from fields of the data, such as a title, image, badges and a short description. Use it for catalogs, project boards or team directories.

Properties​

Property
Description
Expected Value
DataThe records to show, one card per row, usually from a query.Array
Title fieldThe field shown as each card's title.Text. Default: name
Subtitle fieldThe field shown under the title.Text
Image field (URL)The field that holds an image URL for each card. Cards show a picture only when this is set.Text
Badge fieldThe field shown as a badge next to the title.Text. Default: cuisine
More badge fields (comma list, e.g. 'diet, spice')More fields shown as badges, as a comma-separated list such as diet, spice.Text
Eyebrow field (a small line above the title)The field shown as a small line above the title.Text
Avatar field (image URL or a name)The field shown as an avatar, holding an image URL or a name to show as initials.Text
Description fieldThe field shown as the card's body text.Text. Default: note
Progress field (a percentage, 0 to 100)The field shown as a progress bar, holding a percentage from 0 to 100.Text
Meta fields (comma list; 'prep:{} min')Fields shown in a small line at the bottom of the card, comma-separated. Add a label after a colon, with {} where the value goes, such as prep:{} min.Text. Default: prep:{} min, serves:Serves
Id fieldThe field that identifies each record. Its value for the selected card is exposed as selectedItemId.Text. Default: id
Layoutstacked puts the image above the text; row puts it beside the text.stacked, row. Default: stacked
Columns (0 fits as many as the width allows)How many cards to show per row. Use 0 to fit as many as the width allows.Number. Default: 3
Minimum card width (px)The narrowest a card can get. The grid shows fewer columns rather than squeeze cards below it.Number. Default: 240
Image shapeWidth-to-height shape of the card images.16/9, 4/3, 1/1. Default: 4/3
Show imageShows the picture area on each card when Image field is set.On or off. Default: On
Card styleLook of the cards: with a shadow (elevated), with a border (outline) or plain (flat).elevated, outline, flat. Default: elevated
Highlight the selected cardHighlights the selected card. When on, clicking the selected card again clears the selection.On or off. Default: On
Empty textMessage shown when there are no records.Text. Default: Nothing here yet
Loading lookWhat shows while the component is loading: a Spinner or a Skeleton placeholder in the component's shape.Spinner, Skeleton. Default: Spinner

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off
Dynamic heightLets the component grow with its content in the running app instead of keeping a fixed height.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On card clickedTriggers when the user clicks a card.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Clear selectionClears the selected card.components.cardgrid1.clearSelection()
Set visibilityShows the component when true, hides it when false.components.cardgrid1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.cardgrid1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.cardgrid1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
dataThe records to show, one card per row, usually from a query.{{components.cardgrid1.data}}
titleFieldThe field shown as each card's title.{{components.cardgrid1.titleField}}
subtitleFieldThe field shown under the title.{{components.cardgrid1.subtitleField}}
imageFieldThe field that holds an image URL for each card. Cards show a picture only when this is set.{{components.cardgrid1.imageField}}
badgeFieldThe field shown as a badge next to the title.{{components.cardgrid1.badgeField}}
badgeFieldsMore fields shown as badges, as a comma-separated list such as diet, spice.{{components.cardgrid1.badgeFields}}
eyebrowFieldThe field shown as a small line above the title.{{components.cardgrid1.eyebrowField}}
avatarFieldThe field shown as an avatar, holding an image URL or a name to show as initials.{{components.cardgrid1.avatarField}}
descriptionFieldThe field shown as the card's body text.{{components.cardgrid1.descriptionField}}
progressFieldThe field shown as a progress bar, holding a percentage from 0 to 100.{{components.cardgrid1.progressField}}
metaFieldsFields shown in a small line at the bottom of the card, comma-separated. Add a label after a colon, with {} where the value goes, such as prep:{} min.{{components.cardgrid1.metaFields}}
idFieldThe field that identifies each record. Its value for the selected card is exposed as selectedItemId.{{components.cardgrid1.idField}}
layoutstacked puts the image above the text; row puts it beside the text.{{components.cardgrid1.layout}}
columnsHow many cards to show per row. Use 0 to fit as many as the width allows.{{components.cardgrid1.columns}}
minCardWidthThe narrowest a card can get. The grid shows fewer columns rather than squeeze cards below it.{{components.cardgrid1.minCardWidth}}
imageAspectWidth-to-height shape of the card images.{{components.cardgrid1.imageAspect}}
showImageShows the picture area on each card when Image field is set.{{components.cardgrid1.showImage}}
cardStyleLook of the cards: with a shadow (elevated), with a border (outline) or plain (flat).{{components.cardgrid1.cardStyle}}
highlightSelectedHighlights the selected card. When on, clicking the selected card again clears the selection.{{components.cardgrid1.highlightSelected}}
emptyTextMessage shown when there are no records.{{components.cardgrid1.emptyText}}
loadingIndicatorWhat shows while the component is loading: a Spinner or a Skeleton placeholder in the component's shape.{{components.cardgrid1.loadingIndicator}}
selectedItemIdValue of the Id field for the selected card.{{components.cardgrid1.selectedItemId}}
selectedItemThe data row of the selected card.{{components.cardgrid1.selectedItem}}
selectedItemIndexPosition of the selected card, counting from 0, or -1 with none selected.{{components.cardgrid1.selectedItemIndex}}
isVisibleWhether the component is visible.{{components.cardgrid1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.cardgrid1.isLoading}}
isDisabledWhether the component is disabled.{{components.cardgrid1.isDisabled}}

Styles​

Style
Default
Card backgroundTheme: Surface 1
Card border colorTheme: Default border
Title colorTheme: Primary text
Subtitle and meta colorTheme: Placeholder text
Selected card accentTheme: Brand primary
Card radius—
Title typefaceTheme font
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.