Package Exports
- @object-ui/fields
Readme
@object-ui/fields
The standard field library and registry for Object UI.
Features
- π Standard Fields - Implementation of all ObjectStack protocol fields (Text, Number, Date, Lookup, etc.)
- π Plugin System -
FieldRegistryallows registering custom renderers or overriding standard ones. - π Helpers - Utilities for schema mapping, validation, and expression evaluation.
Installation
npm install @object-ui/fieldsField Registry
The Field Registry is the core mechanism that allows decoupling view components from specific field implementations.
Registering a Custom Field
You can override standard fields or add new ones:
import { registerFieldRenderer } from '@object-ui/fields';
import { MyCustomColorPicker } from './MyCustomColorPicker';
// Register a new 'color' field type
registerFieldRenderer('color', MyCustomColorPicker);Using Standard Fields
View components use getCellRenderer to resolve the correct component for a field type.
import { getCellRenderer } from '@object-ui/fields';
const MyGridCell = ({ field, value }) => {
const Renderer = getCellRenderer(field.type);
return <Renderer field={field} value={value} />;
};Standard Field Types
Supported types out of the box:
- Basic:
text,textarea,number,boolean - Format:
currency,percent - Date:
date,datetime,time - Selection:
select,lookup,master_detail - Contact:
email,phone,url - Media:
file,image - System:
formula,summary,auto_number
Compatibility
- React: 18.x or 19.x
- Node.js: β₯ 18
- TypeScript: β₯ 5.0 (strict mode)
@objectstack/spec: ^3.3.0@objectstack/client: ^3.3.0- Tailwind CSS: β₯ 3.4 (for packages with UI)
Links
- π Documentation
- π¦ npm package
- π Changelog
- π Report an issue
- π€ Contributing Guide
- πΊοΈ Roadmap
License
MIT β see LICENSE.