Features
- 30+ Value Types: Comprehensive support for common data types
- Dual Modes: Read-only display and editable input modes
- Automatic Formatting: Smart formatting based on value type
- ValueEnum Support: Map values to display text
- Request Integration: Async options loading
- Extensible: Add custom value types
Basic Usage
Value Types
Text Types
- Text
- TextArea
- Password
Numeric Types
Date & Time Types
Selection Types
Cascading Selection
Display Types
Special Types
ValueEnum
Map values to display text with status badges:Status Colors
Available status values:Success- GreenError- RedWarning- OrangeProcessing- BlueDefault- Gray
Request Integration
Load options asynchronously:Render Customization
Mode Switching
Empty Text
Light Mode
Compact inline editing:Field Components
Individual field components are also exported:Key Props
| Prop | Type | Description |
|---|---|---|
text | any | Field value |
valueType | ProFieldValueType | Value type |
mode | 'read' | 'edit' | Display mode |
fieldProps | any | Props passed to field component |
valueEnum | ValueEnumMap | ValueEnumObj | Value enum mapping |
request | () => Promise<RequestData> | Async options loader |
params | any | Request parameters |
render | (text, props, dom) => ReactNode | Custom render function |
light | boolean | Compact light mode |
proFieldProps | ProFieldProps | ProField specific props |
Custom Value Types
Register custom value types:Best Practices
Choose the right value type
Choose the right value type
Use specific value types instead of generic ones:
- Use
moneyinstead ofdigitfor currency - Use
percentinstead ofdigitfor percentages - Use
dateTimeinstead oftextfor timestamps
Leverage valueEnum for status fields
Leverage valueEnum for status fields
Use valueEnum with status for automatic badge rendering:
Use request for dynamic options
Use request for dynamic options
Load select/radio options from API using request prop instead of static valueEnum.
Set appropriate empty text
Set appropriate empty text
Provide meaningful empty text for better UX:
Value Type Reference
All Value Types
All Value Types
text- Plain texttextarea- Multi-line textpassword- Password inputdigit- Numeric inputdigitRange- Numeric rangemoney- Currencypercent- Percentageprogress- Progress bardate- Date pickerdateTime- DateTime pickertime- Time pickerdateRange- Date rangedateTimeRange- DateTime rangefromNow- Relative timeselect- Select dropdownradio- Radio groupcheckbox- Checkbox groupswitch- Toggle switchrate- Star ratingslider- Slider inputsegmented- Segmented controlcascader- Cascading selecttreeSelect- Tree selectavatar- Avatar displayimage- Image displaycode- Code displayjsonCode- JSON viewercolor- Color pickerindex- Index numberindexBorder- Bordered indexoption- Action buttons
Related Components
- ProForm - Form fields using ProField
- ProTable - Table cells using ProField
- ProDescriptions - Description items using ProField