Dyrected
Model ContentFields

Email

A text field that validates its value as an email address.

The email field is a text field that checks its value looks like an email address before it saves. Use it for editor-supplied addresses — a contact email, a notification recipient — where you want the format validated without writing your own check.

defineEmailField({ name: 'contactEmail', label: 'Contact email', required: true })

The format check is built in, so you don't need extra validation for the common case. Like other text fields, it accepts an advisory maxLength.

Authentication collections already include an email field that Dyrected injects for you. You can define your own instead: Dyrected keeps your definition but always re-asserts the parts the login flow depends on — required, unique, and its access update rule — so a custom email field can never accidentally allow duplicate accounts.

Making the address clickable

Set admin.format to 'link' and the email renders as a mailto: link in the admin list, so you can reach someone straight from the table instead of copying the address out:

defineEmailField({ name: 'contactEmail', label: 'Contact email', admin: { format: 'link' } })

This only changes how the value displays; the stored string is a plain email address either way.

Generated reference

The contract below is generated from the public @dyrected/core exports by @dyrected/knowledge, so it stays in sync with the package. See Fields for the shared field options every type accepts.

EmailField

Exported type from @dyrected/core.

export type EmailField = TypedField<"email", string, EmailFieldAdmin> &
  CharacterLimitFieldConfig;

EmailFieldAdmin

Exported type from @dyrected/core.

export type EmailFieldAdmin = CharacterLimitFieldAdmin & {
  /** How the value is displayed in read-only Admin surfaces. Does not affect storage or editing. */
  format?: LinkFormat;
};

LinkFormat

How a url or email value is presented in read-only Admin surfaces. Renders the value as a clickable link (a mailto: link for email) instead of plain text. Display only.

export type LinkFormat =
  /** Shorthand for `{ type: "link" }`. */
  | "link"
  | {
      type: "link";
      /** Open the link in a new tab. Defaults to `true`. */
      newTab?: boolean;
    };

On this page

Dyrected| Cloud

Get your backend ready in minutes

Use a managed database, storage, APIs, and admin dashboard without setting up the infrastructure yourself.

Set Up My Backend