Files
firecms/website/docs/api/interfaces/stringfieldconfig.md
2021-06-06 13:36:47 +02:00

4.0 KiB

id, title, sidebar_label, sidebar_position, custom_edit_url
id title sidebar_label sidebar_position custom_edit_url
stringfieldconfig Interface: StringFieldConfig StringFieldConfig 0 null

Possible configuration fields for a string property. Note that setting one config disables the others.

Hierarchy

Properties

customProps

Optional customProps: any

Additional props that are passed to the components defined in field or in preview.

Inherited from

FieldConfig.customProps

Defined in

models/models.ts:821


enumValues

Optional enumValues: EnumValues

You can use the enum values providing a map of possible exclusive values the property can take, mapped to the label that it is displayed in the dropdown. You can use a simple object with the format value => label, or with the format value => EnumValueConfig if you need extra customization, (like disabling specific options or assigning colors). If you need to ensure the order of the elements, you can pass a Map instead of a plain object.

Defined in

models/models.ts:853


field

Optional field: ComponentType<FieldProps<string, any, EntitySchema<any, any>, any>>

If you need to render a custom field, you can create a component that takes FieldProps as props. You receive the value, a function to update the value and additional utility props such as if there is an error. You can customize it by passing custom props that are received in the component.

Inherited from

FieldConfig.field

Defined in

models/models.ts:808


markdown

Optional markdown: boolean

Should this string property be displayed as a markdown field. If true, the field is rendered as a text editors that supports markdown highlight syntax. It also includes a preview of the result.

Defined in

models/models.ts:842


multiline

Optional multiline: boolean

Is this string property long enough so it should be displayed in a multiple line field. Defaults to false. If set to true, the number of lines adapts to the content

Defined in

models/models.ts:835


preview

Optional preview: ComponentType<PreviewComponentProps<string, any>>

Configure how a property is displayed as a preview, e.g. in the collection view. You can customize it by passing custom props that are received in the component.

Inherited from

FieldConfig.preview

Defined in

models/models.ts:815


previewAsTag

Optional previewAsTag: boolean

Should this string be rendered as a tag instead of just text.

Defined in

models/models.ts:870


storageMeta

Optional storageMeta: StorageMeta

You can specify a StorageMeta configuration. It is used to indicate that this string refers to a path in Google Cloud Storage.

Defined in

models/models.ts:859


url

Optional url: boolean | MediaType

If the value of this property is a URL, you can set this flag to true to add a link, or one of the supported media types to render a preview

Defined in

models/models.ts:865