Docyrus

EditableValue

Field-aware inline editor — renders the value, then edits it with the field's own control (inline input or picker sheet).

iOSAndroid
Preview EditableValue on your device

Scan with Expo Go

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

Installation

pnpm dlx @docyrus/cli add @docyrus/rn-editable-value

Usage

import { EditableValue } from '@/components/docyrus-native/editable-value';

<EditableValue
  field={{ id: 'stage', slug: 'stage', name: 'Stage', type: 'field-select' }}
  value={record.stage}
  record={record}
  enumOptions={stageOptions}
  onValueChange={value => save({ stage: value })}
  editHint="visible" />

{/* Money: the currency companion arrives through onCompanionChange */}
<EditableValue
  field={{ id: 'budget', slug: 'budget', name: 'Budget', type: 'field-money' }}
  value={record.budget}
  record={record}
  onValueChange={value => save({ budget: value })}
  onCompanionChange={changes => save(changes)} />

{/* Legacy plain-text mode (no field) */}
<EditableValue value={title} onValueChange={setTitle} placeholder="Tap to edit..." />

Behaviour

Field kindTapCommit
field-checkbox, field-switchToggles in placeImmediately
field-ratingOpens the starsOn change
Single pickers (select, enum, status, relation, userSelect, date, dateRange, color, icon, locationSelect, queryBuilder)Opens the field's sheet straight away (autoOpen)On selection; dismissing cancels
Multi pickers (multiSelect, tagSelect, userMultiSelect) and compound fields (money, phone, duration, currency, dateTime, time)Opens the editorExplicit ✓ / ✕ (forced)
Text-like (text, number, email, password, url, percent, code)Inline inputBlur / return (or ✓ with showActions)

API Reference

EditableValueProps

PropTypeDefaultDescription
fieldIField—Field definition — picks the renderer and the editor. Omit for legacy plain-text mode
valueunknown—Current value (required)
onValueChange(value: unknown) => void—Committed value
onCompanionChange(changes: Record<string, unknown>) => void—Companion changes on commit ({ __budget_currency: 'EUR' })
recordRecord<string, unknown>—Full record (companion values)
enumOptionsEnumOption[]—Options for select-based fields
disabledbooleanfalsePrevent entering edit mode
readOnlybooleanfalseShow the value without an edit affordance
editHint'progressive' | 'visible''progressive'visible always shows a pencil hint
childrenReactNode—Custom display content (overrides DocyValueDynamic)
showActionsbooleantext: false, others: true✓ / ✕ buttons while editing (forced for multi / compound fields)
explicitSavebooleanfalseBlur does not save (forced for multi / compound fields)
editingboolean—Controlled editing state
onEditingChange(editing: boolean) => void—Editing state change
trackChangesbooleanfalseApply changed styling
changedbooleanfalseMark as changed
appSlug / dataSourceSlugstring—Dynamic enum loading context
clientRestApiClient—Threaded into renderer / editor
variant'default' | 'ghost''default'Row chrome
size'sm' | 'default' | 'lg''default'Row size
placeholderstringui.editableValue.placeholderLegacy mode: empty placeholder
multilinebooleanfalseLegacy mode: multiline input
onLoadMore / hasMore / onSearch / searching——Picker pagination / remote search
onCreateRecord / renderCreateForm / itemTemplate——Relation create / option template
onImageUpload / onFileUploadFieldUploadHandler—Upload handlers
onExpand / renderExpandContent / expandIcon——Relation expand
onComposeEmail / onSendMessage(address: string) => void—Email / phone actions
classNamestring—Additional classes

Not ported from web: the external TanStack form prop (native fields are controlled) and the ref prop.

Exports

ExportDescription
EditableValueComponent
editableValueVariantstv() variants
EditableValuePropsProps type

Breaking changes (web-parity release)

  • value / onValueChange are unknown (were string); pass field for typed editing.
  • showActions defaults to false for text-like fields (was true for everything); legacy mode keeps actions on.
  • Default placeholder copy comes from ui.editableValue.placeholder (“Tap to edit...”).

On this page