Import it from @grafloria/renderer.
Complete property schema for a node type
A property schema defines how all properties of a node type should be edited in the UI. It includes:
- Property definitions (what to edit and how)
- Optional groups (for organization)
- Optional metadata (versioning, documentation)
tsinterface PropertySchema
Properties
| Name | Type | Default | Description |
|---|---|---|---|
properties | PropertyDefinition[] | List of property definitions | |
groups? | PropertyGroup[] | Optional property groups for organization | |
metadata? | { /** * Schema version (e.g., '1.0.0') */ version?: string; /** * Schema author or creator */ author?: string; /** * Description of what this schema is for */ description?: string; } | Schema metadata |
Example
Simple schema
typescriptconst schema: PropertySchema = {
properties: [
{
key: 'name',
label: 'Name',
editor: 'string',
validation: { required: true }
},
{
key: 'enabled',
label: 'Enabled',
editor: 'boolean'
}
]
};
Example
Complete schema with groups
typescriptconst schema: PropertySchema = {
properties: [
{
key: 'tableName',
label: 'Table Name',
editor: 'string',
validation: { required: true },
group: 'basic'
},
{
key: 'columns',
label: 'Columns',
editor: 'json',
group: 'schema'
},
{
key: 'primaryKey',
label: 'Primary Key',
editor: 'select',
options: [],
group: 'schema'
}
],
groups: [
{ name: 'basic', label: 'Basic Information', order: 1 },
{ name: 'schema', label: 'Schema Definition', order: 2 }
],
metadata: {
version: '1.0.0',
author: 'System',
description: 'Property schema for database tables'
}
};
Was this page helpful?