ErField
9 Jul 20261 minute to read
Defines a single field within an ER entity.
A field can represent a database column or a logical entity attribute. Each
field supports independent primary key and foreign key indicators, optional
data type display text, supported constraints, visual row style, and field
text styling.
Properties
annotation ShapeAnnotationModel
Defines text styling for the ER field row.
Only annotation.style is applicable. The annotation.content
property is ignored — the name property is always used as the
field display text.
Defaults to {}
constraints ErFieldConstraint[]
Defines additional constraints applied to the field.
Accepts one or more ErFieldConstraint values.
Defaults to []
dataType string
Defines the data type label displayed for the field.
This value is treated as display text by the diagram component. Examples
include INT, VARCHAR(255), and DECIMAL(10,2).
Defaults to ’’
id string
Defines the unique identifier of the field within its parent entity.
This identifier is used by runtime APIs such as removeErField. The value
must be unique within the parent ER entity.
Defaults to ’’
isForeignKey boolean
Indicates whether the field is a foreign key.
When enabled, a foreign key indicator is rendered for the field. A field
can be both a primary key and a foreign key.
Defaults to false
isPrimaryKey boolean
Indicates whether the field is a primary key.
When enabled, a primary key indicator is rendered for the field. A field
can be both a primary key and a foreign key.
Defaults to false
name string
Defines the display name of the field.
This typically represents the database column name or logical attribute
name shown in the ER entity field row.
Defaults to ’’
style ShapeStyleModel
Defines the visual style of the ER field row.
Supports standard shape style properties such as fill, stroke color,
stroke width, opacity, and other supported diagram style values.
Field-level style values override applicable values from field defaults.
Defaults to { fill: ‘none’, strokeColor: ‘none’, strokeWidth: 0 }