Data Model

Interfaces

Manage your data effectively with Directus fields. Discover various field types, interfaces, validations, and relationships to perfectly suit your data modeling needs.

Interfaces are how users interact with fields in Editor. Each interface supports specific data types and configurations.

Text & Numbers

Input

A standard form text input

A standard form input.

ConfigurationOptions
TypesString, Text, UUID, Integer, Big Integer, Float, Decimal
LengthUsed to limit number of characters in the database.
Soft LimitUsed to limit the number of characters within the Data Studio.
TrimToggle to trim whitespace at start and end of the value.
MaskedToggle to hide the typed value with • values.
Cleared ValueToggle to save cleared value as an empty string.
SlugifyToggle to make the entered value URL safe.

Autocomplete Input (API)

An autocomplete form text input that shows a dropdown list of options based on a search query

A search input that will populate dropdown choices by making a request to a given URL.

ConfigurationOptions
TypesString, Text
URLThe request URL with dynamic {{ value }}.
Results PathThe returned object path using dot notation containing an array with search results.
Text PathThe value within each object that displays for each search result.
Value PathThe value within each object that is stored for each search result.
TriggerSelect between throttle and debounce.
RateThe delay in milliseconds used for the trigger.
Throttle vs Debounce
Throttle and debounce are very similar. Debounce will wait until a period of 'silence' has happened before making the request, while throttle will keep making requests at most 1 call every period. Period is set in the 'rate' configuration for this interface.

Block Editor

Showcase of the block editor with example blocks

Allows users to create and edit content using blocks. These blocks represent individual pieces of content, such as text, images, videos, buttons, and more, that can be assembled and re-arranged within a flexible layout.

ConfigurationOptions
TypesJSON
ToolbarAllows for customization of visible formatting options.
Root FolderDefault folder to store uploaded files. Does not affect existing files.

Code

A code editor input

Code editor for pre-formatted text.

ConfigurationOptions
TypesString, Text, JSON, Geometry (All)
LanguageLanguage for syntax highlighting. Can be set when type is not JSON.
Line NumberToggle to show line numbers.
Line WrappingToggle to wrap text to prevent horizontal scrolling.
TemplatePreset value that the user can add to the field value by clicking "Fill with Template Value".

Textarea

A standard form textarea input

Textarea input for longer plain text.

ConfigurationOptions
TypesText
Soft LimitUsed to limit the number of characters within the Data Studio.

WYSIWYG

A What You See Is What You Get (WYSIWYG) form input that has a toolbar for formatting

The What You See Is What You Get (WYSIWYG) editor provides a text area with rich formatting options in the toolbar.

ConfigurationOptions
TypesText
ToolbarAllows for customization of visible formatting options
FolderDefault folder to store uploaded files. Does not affect existing files.
Soft LimitUsed to limit the number of characters within the Data Studio.
Static Access TokenToken appended to asset URLs when displaying in the editor.
Custom FormatsJSON array of formatting that is passed to the style_formats config option of the WYSIWYG editor instance. TinyMCE Documentation
Options OverrideJSON object to override the default config option of the WYSIWYG editor instance. TinyMCE Documentation

Markdown

A markdown text editor with a toolbar with formatting options. Edit and preview tabs.

Markdown text editor with formatting options in the toolbar. You can switch between Edit and Preview modes.

ConfigurationOptions
TypesText
ToolbarAllows for customization of visible formatting options.
Root FolderDefault folder to store uploaded files. Does not affect existing files.
Static Access TokenToken appended to asset URLs when displaying in the editor.
Soft LimitUsed to limit the number of characters within the Data Studio.
Custom BlocksEach block adds an icon to the toolbar, and wraps the cursor in specific characters.

Tags

A standard form text input where user can select, add, and remove tags.

A text input that allows users to apply any number of tags. When adding new tag, press Enter to save the tag.

ConfigurationOptions
TypesJSON, CSV
PresetsPreset tags that the user can select.
AlphabetizeToggle to force tags to display in alphabetical order.
Allow OtherToggle to allow users to add new tags.
WhitespaceForce whitespace to be removed or replaced with hyphens or underscores.
CapitalizationForce tags to be stored as lowercase, uppercase, or title case.

Selection

Toggle

A toggle form input with label named "Enabled"

A checkbox input that allows user to toggle boolean values.

ConfigurationOptions
TypesBoolean
Default Valuetrue, false, null
Icon OnIcon that shows whenever the toggle is enabled.
Icon OffIcon that shows whenever the toggle is disabled.
Color OnColor of the icon whenever the toggle is enabled.
Color OffColor of the icon whenever the toggle is disabled.
LabelThe text displayed to the user beside the toggle.

Datetime

A date picker input. User can select a calendar date and input a time.

Date picker input that allows user to select a date and time.

ConfigurationOptions
TypesDateTime, Date, Time, Timestamp
Include SecondsShow seconds in the interface.
Use 24-Hour FormatUse 24 hour time system.
Handling Timezones
The DateTime type does not have timezone information, and will always store values as UTC. The Timestamp type contains timezone information.

Repeater

A repeater field

A repeater field, open

A repeating group of fields. You can use any field in a repeater, except for relational, presentation, or group fields. The value is stored as a JSON array of objects.

ConfigurationOptions
TypesJSON
TemplateLabel shown in the repeater items using display templates. Defaults to {{ title }}.
"Create New" LabelLabel for the button to create a new item below the field in the editor. Defaults to "Create New".
SortMethod of sorting the items groups within the repeater.
Edit FieldsThe configuration for fields within the repeater.

Each field in a repeater has further configuration options.

ConfigurationOptions
FieldUnique name for the field - used as the property key and in the repeater's template option.
TypeData type of property values.
InterfaceThe interface to use for the field.
Interface OptionsOption configuration for the selected interface.
DisplayThe display to use for the preview on each item.

Map

An interactive map interface that shows a single point on the east coast of the United States. Map has buttons for zoom, search, and full screen.

Show and set geospatial data on an interactive map. Mapping data is stored as GeoJSON.

Maps Provider
By default, Directus will use OpenStreetMap to display your mapping data.By entering a Mapbox API key, you can enhance the platform's mapping experience.
ConfigurationOptions
Types
  • Point: A single location on a map.
  • LineString: A series of points on a map connected in a line.
  • Polygon: An area of a map drawn by selecting vertices.
  • Multipoint: A series of disconnected points on a map.
  • MultiLineString: A series of LineString objects.
  • MultiPolygon: A series of Polygon objects.
  • Geometry (All): An series of Point, LineString and Polygon objects.
  • JSON: A Geometry (All) object stored as JSON.
  • String: A Geometry (All) object stored a string of characters.
  • Text: A Geometry (All) object stored as Text.
  • CSV: A Geometry (All) object stored as comma-separated values.
Default ViewThe default location and zoom settings on the map to show by default
Database Support
Your database must support geospatial data or have a geospatial plugin installed, such as PostGIS or SpatiaLite, to fully utilize mapping functionality with Directus.

Color

A text input for color hex codes that allows user to select color modes

A color picker interface that allows users to input color codes and convert between different color modes.

ConfigurationOptions
TypesString
OpacityEnable opacity values to be adjusted by the user.
Preset ColorsPreset colors that users can select.

A select input with a dropdown of options.

Input that allows the user to select a value from a dropdown list of options.

ConfigurationOptions
TypesString, Integer, Big Integer, Float, Decimal
ChoicesOptions for the dropdown. Each option contains text that is displayed to the user and a value that is stored.
Allow OtherAllow user to enter custom values other than preset values.
Allow NoneAllow user to deselect an option.

A select input where user can select multiple options from a dropdown.

Input that allows user to select multiple values from a list of options.

ConfigurationOptions
TypesJSON, CSV
ChoicesOptions for the dropdown. Each option contains text that is displayed to the user and a value that is stored.
Allow OtherAllow user to enter custom values other than preset values.
Allow NoneAllow user to deselect an option.

Icon

A select input with a dropdown grid of icon choices.

Allow the user to select from a list of icons. Icons are from the Google Material Symbols library and cannot be swapped for another library.

ConfigurationOptions
TypesString

Checkboxes

A form input with multiple checkboxes.

Input that allows user to select multiple checkboxes.

ConfigurationOptions
TypesJSON, CSV
ChoicesOptions for the checkboxes. Each option contains text that is displayed to the user and a value that is stored.
Allow OtherAllow user to enter custom values other than preset values.
ColorColor of the checkboxes.
Icon On/OffIcons shown whenever a checkbox is checked/unchecked.
Items ShownNumber of checkboxes before a 'Show More' toggle is shown.

Checkboxes (Tree)

A form input with a nested tree of multiple parent and child checkboxes.

Nested tree of checkboxes that can be expanded or collapsed.

ConfigurationOptions
TypesJSON, CSV
ChoicesOptions for the checkboxes. Each option contains text that is displayed to the user and a value that is stored, along with any child options.
Choice ChildrenChild checkboxes nested below the current choice.
Value CombiningControls what value is stored when nested selections are made. All, Branch, Leaf, Indeterminate, Exclusive.
Understanding Value Combining Options
In a Checkboxes (Tree) interface, checkboxes can exist within a parent checkbox. Value combining determines the final value when selecting items in a tree.
  • All returns all checked values.
  • Branch returns the top-most values that are selected.
  • Leaf returns the deepest values that are selected
  • Indeterminate returns checked items, and always returns a parent when one or more children are selected.
  • Exclusive returns either the parent or child elements, but not both.

Radio Buttons

A radio button form input with different options to select

Radio button input that allows users to select a single value from multiple choices.

ConfigurationOptions
TypesString, Integer, Big Integer, Float
ChoicesOptions for the radio buttons. Each option contains text that is displayed to the user and a value that is stored.
Allow OtherAllow user to enter custom values other than preset values.

Relational

File

A file type form input where user can pick from three options: "Upload File From Device", "Choose Files from Library", "Import File from URL"

Upload a single file of any mime-type, choose an existing file from the file library, or import a file from a URL.

ConfigurationOptions
TypesUUID
Root FolderFolder for the uploaded files. Does not affect the location of existing files.

Image

An image form input where user can pick from three options: "Upload File From Device", "Choose Files from Library", "Import File from URL"

Upload a single image file, choose an existing image from the file library, or import an image from a URL.

ConfigurationOptions
TypesUUID
Root FolderFolder for the uploaded files. Does not affect the location of existing files.
Crop to FitCrop the image as needed when displaying the image.

Files

A file type form input where user can select and upload multiple files.

Upload multiple files, choose existing files from the file library, or import files from URL.

When this field is added to a collection, Directus will create a Many to Many (M2M) junction collection on your behalf.

ConfigurationOptions
TypesAlias
FolderFolder for the uploaded files. Does not affect the location of existing files.
Display TemplateDisplay templates are used to represent an item in relationship fields - for example to show the value of the Title field.

Builder (M2A)

A form interface that allows users to create a relationship from the current item by selecting different items from multiple, distinct Collections.

Create relationships between the current item and multiple items from any number of other collections in a many-to-any (M2A) interface.

When this field is added to a collection, Directus will create a Many to Many (M2M) junction collection on your behalf.

ConfigurationOptions
TypesAlias
Related CollectionsWhich collections should items be selected from.
Allow DuplicatesAllow users to add the same Item multiple times.
Read our tutorial on using a Builder (M2A) to create reusable page components.

Many To Many

A form interface that allows users to select multiple different items from a single collection. Buttons for "Create New" and "Add Existing".

Create relationships between the current item and many different items from a single collection.

When this field is added to a collection, Directus will create a Many to Many (M2M) junction collection on your behalf.

ConfigurationOptions
TypesAlias
Related CollectionWhich collection should items be selected from.
LayoutHow to present items in the editor. List, Table
Junction Fields LocationWhere in the editor the relational field should be added. Top, Bottom
Allow DuplicatesAllow users to add the same Item multiple times.
FilterFilter the list of items a user can select.
Item linkToggle visible link to the item.

One to Many

A form interface that allows users to select multiple items from a single collection. Buttons for "Create New" and "Add Existing".

Create a relationship between the current item and many items from a single collection.

When this field is added to a collection, Directus will create a corresponding Many to One field on the related collection on your behalf.

ConfigurationOptions
TypesAlias
Related CollectionWhich collection should items be selected from.
Foreign KeyName of field in related collection to be created.
LayoutHow to present items in the editor. List, Table
Display TemplateDisplay templates are used to represent an item in relationship fields - for example to show the value of the Title field.
FilterFilter the list of items a user can select.
Item linkToggle visible link to the item.

Tree View

A form interface that shows multiple parent and child items from the same collection. Buttons for "Create New" and "Add Existing".

A special One to Many interface that allows users to create and manage recursive relationships between items from the same collection.

The Tree View interface is only available on self-referencing (recursive) relationships.

ConfigurationOptions
TypesAlias
Related CollectionWhich collection should items be selected from.
Foreign KeyName of field in related collection to be created.
Display TemplateDisplay templates are used to represent an item in relationship fields - for example to show the value of the Title field.
FilterFilter the list of items a user can select.

Many to One

A form interface that allows a user to select a single item from a collection."

Create a relationship between the current item and a single item from single collection.

ConfigurationOptions
TypesAlias
Related CollectionWhich collection should items be selected from.
Display TemplateDisplay templates are used to represent an item in relationship fields - for example to show the value of the Title field.
FilterFilter the list of items a user can select.

Translations

A form interface with two columns and two fields per column - "Title" and "Content". One column contains the English translation for each field. Second column contains the French translation for each field.

Special relational interface designed specifically to handle translations. When this field is added to a collection a Languages Collection will be created by Directus on your behalf if it does not already exist.

ConfigurationOptions
TypesAlias
Languages CollectionWhich collection to use for language selection.
Language Indicator FieldThe field from your languages collection that identifies the language to the user.
Language Direction FieldThe field from your languages collection that identifies the text direction for a selected language.
Default LanguageDefault language to use.
Use Current User LanguageDefault to the current users language.

Presentation

Divider

A horizontal divider between two form fields

A horizontal divider to separate fields into different sections.

A group of two buttons. One primary button. One default button.

Group of one or more buttons that link to a preset or dynamic URL. Each link has the following configuration:

ConfigurationOptions
LabelLabel for the button.
IconIcon displayed beside the button label.
TypeThe colors used by the button. Primary, Normal, Info, Success, Warning, Danger
URLURL to send the user to when the button is clicked. You can use field values from the item to create the URL dynamically.

Notice

A standard warning notice in yellow with a hazard icon.

An alert or notice interface to notify users of important information.

Groups

Accordion

An accordion interface that allows use to expand and collapse different fields.

User-controlled showing and hiding of fields within the group by clicking on each field.

ConfigurationOptions
Accordion ModeToggle whether only one section can be open at a time.
StartAll Closed, First Opened

Detail Group

A group of form fields that are currently hidden behind a toggle.

A group of form fields that are currently visible but can be hidden behind a toggle.

User-controlled showing and hiding of sub-groups by clicking on the group header.

ConfigurationOptions
TypesAlias

Raw Group

A group of form fields

Interface that groups multiple fields together in the data model, with no visual distinction.

ConfigurationOptions
TypesAlias

Other

Collection Item Dropdown

A collection item field

Dropdown to select an item from an existing collection.

ConfigurationOptions
TypesJSON
CollectionWhich collection should items be selected from.
Display TemplateDisplay templates are used to represent an item in relationship fields - for example to show the value of the Title field.
FilterFilter the list of items a user can select.

Hash

Form text input that shows the value is securely hashed.

Text input that allows users to hash the value on save. The Directus APIs can be used to verify the hash.

ConfigurationOptions
TypesHash
MaskedToggle raw value visibility before save.

Slider

A slider input

Range input that allows users to select a number with an interactive slider.

ConfigurationOptions
TypesInteger, Decimal, Big Integer, Float
Minimum ValueMinimum value that can be set by the user.
Maximum ValueMaximum value that can be set by the user.
Step IntervalSpecify the size of each increment (or step) of the slider control.
Always show valueToggle visibility of the numeric value below the slider.