Skip to Content
Kiva

Value Renderers

Read-only display components for Kiva field values — tenant-aware dates / numbers, status companions, approval history, relation expand and more.

iOSAndroid
Preview Value Renderers on your device

Scan with Expo Go

Download Expo Go, then scan the QR code to preview native components.

Overview

Value renderers are read-only components that format a field value by type (web DynamicValue / VALUE_RENDERER_MAP parity). Every renderer accepts KivaValueProps; KivaValueDynamic picks the renderer from field.type (unmapped types fall back to text).

  • Dates, date-times, date ranges and status follow-up dates use the tenant format from useDateFormat() (KivaTenantProvider), falling back to the device locale — never raw ISO strings.
  • Numbers, percents and money use useNumberFormat(), falling back to Intl.NumberFormat.
  • Select-style values accept an id or an expanded { id, name } object.
  • Enum options with both icon and color render as a solid chip with WCAG-contrast text.

Installation

pnpm dlx @kivacore/ui-cli add @kivacore/rn-value-renderers

Usage

import { KivaValueDynamic } from '@/components/kiva-native/value-renderers';

<KivaValueDynamic
  field={{ id: 'stage', slug: 'stage', name: 'Stage', type: 'field-status' }}
  value={record.stage}
  record={record}
  enumOptions={stageOptions} />

<KivaValueDynamic
  field={{ id: 'account', slug: 'account', name: 'Account', type: 'field-relation' }}
  value={{ id: 'acc-1', name: 'Acme' }}
  onExpand={item => router.push(`/accounts/${item.id}`)} />

API Reference

KivaValueProps

PropTypeDefaultDescription
fieldIField—Field definition (required)
valueunknown—Value to display (required)
recordRecord<string, unknown>—Full record — companion columns (__<slug>_currency, __<slug>_country, __<slug>_secondary, __<slug>_description, __<slug>_followup_date)
enumOptionsEnumOption[]—Options for select-based fields
size'sm' | 'md' | 'lg''md'Size scale (native)
uuidbooleanfalseIdentity: compact # chip; press reveals, long-press calls onCopy
onCopy(text: string) => void—Identity copy handler (wire expo-clipboard)
onExpand(item: { id; name? }) => void—Relation expand button
renderExpandContent(item: { id; name? }) => ReactNode—Relation expand content (bottom sheet)
expandIconReactNode—Custom expand glyph
onComposeEmail(email: string) => void—Email: open the app composer instead of mailto:
onSendMessage(phone: string) => void—Phone: send-message button
clientRestApiClient—Email: compose button opening EmailComposeDialog. Phone: message button opening InstantMessageComposeDialog. onComposeEmail / onSendMessage win when set
classNamestring—Container class
textClassNamestring—Text class (native)

Field type → renderer (VALUE_RENDERER_MAP)

TypesRenderer
field-text, -textarea, -display, -codeKivaValueText
field-passwordKivaValuePassword (masked + eye toggle)
field-number / -percent / -money / -duration / -ratingNumber / Percent / Money / Duration / Rating (field.maxRating)
field-checkbox / -switchCheckbox / Switch
field-email / -phone / -urlEmail / Phone / Url
field-color / -icon / -currencyColor / Icon / CurrencyCode
field-select, -enum, -systemEnumKivaValueSelect
field-multiSelect, -tagSelectKivaValueMultiSelect
field-radioGroup / -status / -approvalStatus / -listRadioGroup / Status / ApprovalStatus / List
field-userSelect / -userMultiSelect / -relationUser / UserMulti / Relation
field-date / -dateTime / -time / -dateRangeDate / Datetime / Time / DateRange
field-file / -image / -avatarFile / Image / Avatar
field-htmlEditor, -emailEditorKivaValueRichText
field-markdownKivaValueMarkdown
field-codeEditor, -jsonata, -handlebarsKivaValueCode
field-docEditorKivaValueDocEditor (Plate JSON → preview text)
field-json, -jsonSchema, -queryBuilder, -inlineFormKivaValueJson
field-adaptiveCardKivaValueAdaptiveCard (summary)
field-inlineData, -schemaRepeater, -systemBuffer, -systemVector, -systemTextArray, -systemUuidArrayKivaValueInlineData
field-taskList / -todo / -locationSelectTaskList / Todo / Location
field-conversationChannel / -fileStorageFolderConversationChannel / FileStorageFolder
field-button / -formula / -relatedFieldButton / Formula / RelatedField
field-identity, -autonumberKivaValueIdentity

Notable renderers

KivaValueStatus

Solid primary badge, the sub-status (__<slug>_secondary), notes (__<slug>_description) and follow-up date (__<slug>_followup_date, tenant date format).

KivaValueApprovalStatus

Status badge, last-response summary (actor avatar, time, comments) and response history. Bare status strings and the legacy array-of-steps shape are supported.

KivaValueRelation

Resolves an expanded { id, name } object or an id via enumOptions; onExpand / renderExpandContent add a trailing expand button (content opens in a bottom sheet).

KivaValueIdentity

# + id; uuid mode shows a compact chip that reveals the id on press. onCopy is called on long-press.

KivaValueImage / KivaValueFile

Accept StoredFileValue, URL strings and arrays. Images render a gallery strip (4 + +N) for arrays; files show the basename of file_name and the size.

KivaValueDocEditor

Parses the persisted Plate JSON into a single preview line (80 chars); plain text / HTML still accepted.

KivaValueMarkdown / KivaValueAdaptiveCard / KivaValuePassword

Markdown via the shared renderer; adaptive cards as 3 elements · 1 action; passwords masked by default.

Utilities

ExportDescription
extractEnumId(value) / extractEnumLabel(value)Id / label from a primitive or expanded object
useValueDateFormatter(kind)Tenant-aware date / datetime / time formatter
useValueNumberFormatter(fallback?)Tenant-aware number formatter
parseValueDate(value)Date parser (date-only strings are local days)
docEditorPreviewText(value)Plate JSON → preview text
getEnumBadgeColors, getEnumColorValue, shouldRenderEnumOptionChipEnum color helpers
formatDuration, formatMoney, formatDateRange, formatTime, formatPhoneDisplay, getCompanionValue, getCompanionFieldSlug, getCurrencySymbol, parseDateRange, COMMON_CURRENCIESFormatting helpers
KivaValueEmpty, getValueSizeConfigEmpty placeholder + size scale
VALUE_RENDERER_MAPType → renderer registry

Components

ComponentDescription
KivaValueDynamicDispatches on field.type
KivaValueText, KivaValuePassword, KivaValueNumber, KivaValuePercent, KivaValueMoney, KivaValueDuration, KivaValueRatingText & numbers
KivaValueCheckbox, KivaValueSwitchBooleans
KivaValueEmail, KivaValuePhone, KivaValueUrl, KivaValueColor, KivaValueIcon, KivaValueCurrencyCodeContact & appearance
KivaValueSelect, KivaValueMultiSelect, KivaValueStatus, KivaValueRadioGroup, KivaValueUser, KivaValueUserMulti, KivaValueRelation, KivaValueApprovalStatus, KivaValueList, KivaValueConversationChannel, KivaValueFileStorageFolder, KivaValueRelatedField, KivaValueIdentitySelection
KivaValueDate, KivaValueDatetime, KivaValueTime, KivaValueDateRangeDates
KivaValueFile, KivaValueImage, KivaValueAvatarFiles
KivaValueCode, KivaValueJson, KivaValueRichText, KivaValueDocEditor, KivaValueMarkdown, KivaValueAdaptiveCard, KivaValueTaskList, KivaValueTodo, KivaValueInlineData, KivaValueButton, KivaValueFormula, KivaValueLocationComplex

Type Exports

TypeDescription
KivaValuePropsRenderer props
KivaValueRelationItem{ id; name? } handed to expand callbacks
IField, IFieldType, EnumOptionField contract
ValueDateKind'date' | 'datetime' | 'time'

Breaking changes (web-parity release)

  • Dates render in the tenant / locale format; KivaValueNumber / Percent / Money use the tenant number format when a provider is mounted.
  • field-autonumber renders with KivaValueIdentity; field-code with KivaValueText (web parity).
  • KivaValueApprovalStatus shows uppercase workflow statuses plus summary / history.
  • Emoji glyphs replaced by KivaIcon icons.

On this page