Skip to main content

Key Value

Rocket 2.0

The Key Value component shows a record as a list of labels and values, such as a customer's details or an order summary. Rows can be typed so that amounts, dates, statuses, links and yes/no values are formatted for reading.

Properties​

Property
Description
Expected Value
Data (object or array)The details to show: an object, or a list of rows like { label, value, type }. A row's type can be text, number, currency, date, datetime, badge, link or boolean.Object
ColumnsHow many columns the rows are spread across. Fewer columns are used when the component is too narrow to fit them.1, 2, 3, 4. Default: 1
LayoutWhere each label sits. inline puts the label beside the value; stacked puts it above.stacked, inline. Default: inline
Label width (side by side; px or %)Width of the label beside its value when Layout is inline, in pixels or a percentage such as 40%.Text. Default: 40%
DividersDraws a line between rows.On or off. Default: On
Empty value textText shown in place of an empty value.Text. Default: —
Currency (currency rows)Currency code used for currency rows, such as USD or EUR.Text. Default: USD
Number localeLocale used to format numbers and amounts, such as en-US or de-DE.Text. Default: en-US
Date format (date rows)Format for date rows, such as DD MMM YYYY.Text. Default: DD MMM YYYY
Badge colours by valueColors for badge rows by value, for example { Active: '#16a34a' }.Object. Default: {"Active": "#16a34a"}
Copy button on hoverShows a button next to each value that copies it to the clipboard.On or off. Default: Off
Loading lookWhat shows while the component is loading: a Spinner or a Skeleton outline of the rows.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 field clickTriggers when the user clicks a row, or presses Enter or Space on it.

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
Set visibilityShows the component when true, hides it when false.components.keyvalue1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.keyvalue1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.keyvalue1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
dataThe details to show: an object, or a list of rows like { label, value, type }. A row's type can be text, number, currency, date, datetime, badge, link or boolean.{{components.keyvalue1.data}}
columnsHow many columns the rows are spread across. Fewer columns are used when the component is too narrow to fit them.{{components.keyvalue1.columns}}
layoutWhere each label sits. inline puts the label beside the value; stacked puts it above.{{components.keyvalue1.layout}}
labelWidthWidth of the label beside its value when Layout is inline, in pixels or a percentage such as 40%.{{components.keyvalue1.labelWidth}}
dividersDraws a line between rows.{{components.keyvalue1.dividers}}
emptyTextText shown in place of an empty value.{{components.keyvalue1.emptyText}}
currencyCurrency code used for currency rows, such as USD or EUR.{{components.keyvalue1.currency}}
localeLocale used to format numbers and amounts, such as en-US or de-DE.{{components.keyvalue1.locale}}
dateFormatFormat for date rows, such as DD MMM YYYY.{{components.keyvalue1.dateFormat}}
badgeColorsColors for badge rows by value, for example { Active: '#16a34a' }.{{components.keyvalue1.badgeColors}}
allowCopyShows a button next to each value that copies it to the clipboard.{{components.keyvalue1.allowCopy}}
loadingIndicatorWhat shows while the component is loading: a Spinner or a Skeleton outline of the rows.{{components.keyvalue1.loadingIndicator}}
lastClickedFieldThe label and value of the row the user clicked last.{{components.keyvalue1.lastClickedField}}
isVisibleWhether the component is visible.{{components.keyvalue1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.keyvalue1.isLoading}}
isDisabledWhether the component is disabled.{{components.keyvalue1.isDisabled}}

Styles​

Style
Default
Label colorTheme: Placeholder text
Value colorTheme: Primary text
Divider colorTheme: Default border
Link colorTheme: Brand primary
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.