Components
Value Renderers
Read-only value display system for table cells, detail views, and kanban cards. 44 renderer types with automatic dispatch via DynamicValue.
Client Only
Installation
pnpm dlx @docyrus/cli add @docyrus/ui-value-renderersUI Primitives(3 components)
npx shadcn@latest add avatar badge buttonUsage
import { DynamicValue } from '@docyrus/ui/components/value-renderers';
import type { IField, DocyrusValueProps } from '@docyrus/ui/components/value-renderers';
const fields: IField[] = [
{ id: '1', name: 'Full Name', slug: 'full_name', type: 'field-text' },
{ id: '2', name: 'Priority', slug: 'priority', type: 'field-select' },
{ id: '3', name: 'Status', slug: 'status', type: 'field-status' },
];
const record = {
full_name: 'Erhan ERDOGAN',
priority: 'high',
status: 'in_progress',
__status_description: 'Working on API',
};
const enumOptions = [
{ id: 'low', name: 'Low', color: '#22c55e' },
{ id: 'medium', name: 'Medium', color: '#f59e0b' },
{ id: 'high', name: 'High', color: '#ef4444' },
];
function RecordDetail() {
return (
<div>
{fields.map((field) => (
<DynamicValue
key={field.id}
field={field}
value={record[field.slug]}
record={record}
enumOptions={field.type === 'field-select' ? enumOptions : undefined}
/>
))}
</div>
);
}Individual Import
You can import individual renderers to reduce bundle size:
import { TextValue } from '@docyrus/ui/components/value-renderers/text-value';
import { SelectValue } from '@docyrus/ui/components/value-renderers/select-value';
import { StatusValue } from '@docyrus/ui/components/value-renderers/status-value';Renderer Types
Text & Content
| Type | Component | Description |
|---|---|---|
field-text | TextValue | Plain text display |
field-textarea | TextValue | Multi-line text (shared renderer) |
field-display | TextValue | Display-only text (shared renderer) |
field-code | TextValue | Code snippet display (shared renderer) |
field-codeEditor | CodeValue | Code block with monospace font |
field-htmlEditor | RichTextValue | Rendered HTML content |
field-emailEditor | RichTextValue | Email template preview |
field-docEditor | DocEditorValue | Document content preview |
field-json | JsonValue | JSON display with formatting |
field-formula | FormulaValue | Formula expression display |
field-relatedField | RelatedFieldValue | Related field value display |
Numbers
| Type | Component | Description |
|---|---|---|
field-number | NumberValue | Formatted number display |
field-money | MoneyValue | Currency-formatted amount |
field-percent | PercentValue | Percentage display |
field-duration | DurationValue | Duration in HH:MM:SS format |
field-rating | RatingValue | Star rating display |
field-currency | CurrencyCodeValue | Currency code with symbol |
Selection
| Type | Component | Description |
|---|---|---|
field-select | SelectValue | Badge with color/icon |
field-radioGroup | SelectValue | Badge display (shared renderer) |
field-enum | SelectValue | Badge display (shared renderer) |
field-multiSelect | MultiSelectValue | Multiple badges |
field-tagSelect | MultiSelectValue | Tag badges (shared renderer) |
field-status | StatusValue | Status badge with description + follow-up date |
field-approvalStatus | ApprovalStatusValue | Approval workflow badge |
field-list | ListValue | List item badge |
Date & Time
| Type | Component | Description |
|---|---|---|
field-date | DateValue | Localized date display |
field-dateTime | DateTimeValue | Localized date + time display |
field-time | TimeValue | Localized time display |
field-dateRange | DateRangeValue | Date range with separator |
Toggle
| Type | Component | Description |
|---|---|---|
field-checkbox | CheckboxValue | Check/X icon indicator |
field-switch | SwitchValue | On/Off text indicator |
Users & Relations
| Type | Component | Description |
|---|---|---|
field-userSelect | UserValue | User avatar with name |
field-userMultiSelect | UserMultiValue | Stacked user avatars |
field-relation | RelationValue | Related record link |
Contact
| Type | Component | Description |
|---|---|---|
field-email | EmailValue | Email link with icon |
field-phone | PhoneValue | Phone with country code |
field-url | UrlValue | URL link with hostname |
Visual
| Type | Component | Description |
|---|---|---|
field-color | ColorValue | Color swatch supporting hex and Tailwind color tokens |
field-icon | IconValue | Rendered Docyrus icon string such as huge ai-brain-03 |
Files & Media
| Type | Component | Description |
|---|---|---|
field-file | FileValue | File name with icon |
field-image | ImageValue | Single image thumbnail or gallery thumbnail group |
field-avatar | AvatarValue | Avatar thumbnail |
Structure
| Type | Component | Description |
|---|---|---|
field-taskList | TaskListValue | Checklist progress |
field-todo | TodoValue | Todo item count |
field-inlineData | InlineDataValue | Inline data row count |
field-locationSelect | LocationValue | Address with map pin |
System
| Type | Component | Description |
|---|---|---|
field-identity | IdentityValue | Identity hash display |
field-autonumber | IdentityValue | Auto-number display |
field-button | ButtonValue | Action button label |
field-conversationChannel | ConversationChannelValue | Channel name |
field-fileStorageFolder | FileStorageFolderValue | Folder name |
API Reference
DynamicValue
Dispatcher component that renders the correct value renderer based on field.type.
Notes:
ColorValueaccepts hex values and Tailwind-style tokens such asemerald-500.IconValueexpects a Docyrus icon string, for examplehuge ai-brain-03.ImageValueaccepts either a single{ file_name, signed_url }object or an array of those objects for gallery-style output.
<DynamicValue
field={fieldConfig}
value={record[fieldConfig.slug]}
record={record}
enumOptions={options}
className="my-value"
/>DocyrusValueProps
All value renderer components share this interface:
| Prop | Type | Default | Description |
|---|---|---|---|
field | IField | — | Field configuration from the data source |
value | unknown | — | The field value to display |
record | Record<string, unknown> | — | Full record for accessing companion columns |
enumOptions | EnumOption[] | [] | Options for select-based fields |
className | string | — | Additional CSS class |
IField
| Field | Type | Description |
|---|---|---|
id | string | Unique field identifier |
name | string | Display label |
slug | string | Record key for accessing the value |
type | IFieldType | Field type — determines which renderer is used |
defaultValue | string | null | Default value |
validations | string[] | null | Validation rules |
readOnly | boolean | null | Read-only flag |
EnumOption
| Field | Type | Description |
|---|---|---|
id | string | Option identifier |
name | string | Display label |
color | string | Color indicator (hex) |
icon | string | Docyrus icon name |
slug | string | Slug value |
sort_order | number | Display order |