Field Type System
Fields in Beaver Builder are defined using configuration arrays in your module’s settings and rendered using Underscore.js templates located inincludes/ui-field-*.php files.
Field Configuration Structure
Available Field Types
Beaver Builder includes a comprehensive set of built-in field types:Basic Input Fields
Text Field
Text Field
Simple text input with optional character limit:From class-fl-builder-ajax.php:85, text fields are commonly used for simple string inputs.
Textarea Field
Textarea Field
Multi-line text input:
Editor Field
Editor Field
WordPress TinyMCE editor:
Selection Fields
Select Field
Select Field
Dropdown select with single or multiple selection:The select field supports:
- Option groups (ui-field-select.php:145-180)
- Field toggling based on selection (ui-field-select.php:64)
- Multi-select mode (ui-field-select.php:53)
Button Group Field
Button Group Field
Media Fields
Photo Field
Photo Field
Image selector with size options:The photo field provides:
- Media library integration (ui-field-photo.php:26-59)
- Image size selection (ui-field-photo.php:99-105)
- SVG support (ui-field-photo.php:80-89)
- External URL support (ui-field-photo.php:19-25)
Multiple Photos Field
Multiple Photos Field
Multiple image selector:
Video Field
Video Field
Video URL input:
Design Fields
Color Field
Color Field
Color picker with opacity support:The color field template (ui-field-color.php:1-27) shows:
- Alpha channel support (ui-field-color.php:3)
- Reset button option (ui-field-color.php:10-18)
- Deferred rendering for performance (ui-field-color.php:2)
Typography Field
Typography Field
Complete typography control with responsive settings:Typography includes (ui-field-typography.php:3-28):
- Font family and weight
- Font size with units (px, em, rem, vw, ch, %)
- Line height
- Letter spacing
- Text alignment
- Text transform
- Text decoration
- Font style and variant
- Text shadow
Border Field
Border Field
Border configuration:
Dimension Field
Dimension Field
Four-sided dimension control (padding, margin):
Shadow Field
Shadow Field
Box or text shadow:
Unit Fields
Special Fields
Link Field
Link Field
Link configuration with target and nofollow:
Icon Field
Icon Field
Icon picker:
Suggest Field
Suggest Field
Auto-suggest field:
Post Type Field
Post Type Field
Post type selector:
Creating Custom Field Types
To create a custom field type, you need two components:1. Register the Field Type
2. Create Field Template
Create a template file following the pattern in ui-field-*.php:3. Load Custom Template
Tell Beaver Builder to load your custom field template:4. Add Field JavaScript
Create the field behavior:5. Use Custom Field
Field Rendering Process
Understanding how fields are rendered helps when creating custom fields:Template Loading
Field templates are loaded from
includes/ui-field-*.php when the settings panel opens.Template Compilation
Underscore.js compiles templates with the
data object containing:data.name- Field namedata.value- Current valuedata.field- Field configurationdata.settings- All module settings
Field Initialization
JavaScript field classes initialize after rendering (FLBuilder.registerFieldClass).
Field Preview System
Fields can trigger live previews using thepreview configuration:
Best Practices
Field Naming
Use descriptive, unique field names to avoid conflicts:
Defaults
Always provide sensible defaults:
Validation
Validate and sanitize field values:
Performance
Use deferred rendering for complex fields:
Related Resources
Module Development
Learn about creating custom modules
AJAX Operations
Handle AJAX in custom fields
CSS Generation
Generate CSS from field values
Settings API
Module settings configuration