Interface

PropertyOptions

PropertyOptions

Members

Array.<object>

# availableValues Optional

If options should be limited to finite set. After setting this

in the UI you will see select box instead of the input

Properties:
Name Type Description
value string | number
label string

View Source adminjs/src/backend/decorators/property/property-options.interface.ts, line 72

object

# components Optional

List of possible overridden components for given property.
Properties:
Name Type Attributes Description
show string <optional>
list string <optional>
edit string <optional>
filter string <optional>

View Source adminjs/src/backend/decorators/property/property-options.interface.ts, line 20

object

# custom Optional

Custom properties passed to the frontend in PropertyJSON
Properties:
Name Type Description
{...} any

View Source adminjs/src/backend/decorators/property/property-options.interface.ts, line 81

string

# description Optional

Description of field. Shown as hoverable hint after label.

To use translations provide it in locale with specified options key from resource

View Source adminjs/src/backend/decorators/property/property-options.interface.ts, line 130

Example
```js
new AdminJS({
  resources: [
    {
      resource: myResource,
      options: {
        properties: {
          myAwesomeProperty: {
            description: "Plane description" || "awesomeHint", // <- message key in locale
          },
        },
      },
    },
  ],
  locale: {
    translations: {
      resources: {
        myResource: {
          messages: {
            awesomeHint: "Locale description",
          },
        },
      },
    },
  },
});
```
boolean

# hideLabel Optional

Whether label should be hidden - false by default

View Source adminjs/src/backend/decorators/property/property-options.interface.ts, line 116

boolean

# isArray Optional

Indicates if given property should be treated as array of elements.

View Source adminjs/src/backend/decorators/property/property-options.interface.ts, line 49

boolean

# isDisabled Optional

Whether given property should be editable or not.

View Source adminjs/src/backend/decorators/property/property-options.interface.ts, line 98

boolean

# isDraggable Optional

Indicates if array elements should be draggable when editing.

It is only usable if the property is an array.

View Source adminjs/src/backend/decorators/property/property-options.interface.ts, line 56

boolean

# isId Optional

Indicates if property should be treated as an ID

View Source adminjs/src/backend/decorators/property/property-options.interface.ts, line 36

boolean

# isRequired Optional

Whether given property should be marked as required.

View Source adminjs/src/backend/decorators/property/property-options.interface.ts, line 110

boolean

# isSortable Optional

Whether given property should be sortable on list or not.

View Source adminjs/src/backend/decorators/property/property-options.interface.ts, line 104

boolean

# isTitle Optional

One of given property should be treated as an "title property". Title property is "clickable"

when user sees the record in a list or show views.

View Source adminjs/src/backend/decorators/property/property-options.interface.ts, line 42

boolean | object

# isVisible Optional

if given property should be visible. It can be either boolean for all possible views, or

you can verify which view in particular should be hidden/shown.

Properties:
Name Type Attributes Description
show boolean <optional>
list boolean <optional>
edit boolean <optional>
filter boolean <optional>

View Source adminjs/src/backend/decorators/property/property-options.interface.ts, line 9

number

# position Optional

position of the field in a list,

title field (isTitle) gets position -1 by default other fields gets position = 100.

View Source adminjs/src/backend/decorators/property/property-options.interface.ts, line 64

object

# props Optional

Additional props passed to the actual React component rendering given property in Edit

component.

Properties:
Name Type Description
{...} any

View Source adminjs/src/backend/decorators/property/property-options.interface.ts, line 88

string

# reference Optional

Name of the resource to which this property should be a reference.

If set - PropertyOptions.type always returns reference

View Source adminjs/src/backend/decorators/property/property-options.interface.ts, line 122