accelade / forms
Form builder components for Accelade - create dynamic forms with text inputs, selects, checkboxes, and more
Fund package maintenance!
dev-master
2026-03-16 09:40 UTC
Requires
- php: ^8.2
- accelade/accelade: ^1.0.0
- accelade/schemas: ^1.0.0
- illuminate/support: ^11.0|^12.0
- illuminate/validation: ^11.0|^12.0
- illuminate/view: ^11.0|^12.0
Requires (Dev)
- laravel/pint: ^1.18
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- dev-master
- dev-dependabot/composer/laravel-e04c92ac96
- dev-dependabot/github_actions/actions/upload-artifact-7
- dev-dependabot/npm_and_yarn/codemirror/lint-6.9.4
- dev-dependabot/npm_and_yarn/tiptap/extension-subscript-3.19.0
- dev-dependabot/npm_and_yarn/codemirror/commands-6.10.2
- dev-dependabot/npm_and_yarn/tiptap/extension-image-3.19.0
- dev-dependabot/npm_and_yarn/googlemaps/js-api-loader-2.0.2
- dev-dependabot/npm_and_yarn/tiptap/extension-table-row-3.19.0
- dev-dependabot/npm_and_yarn/tiptap/extension-table-header-3.19.0
- dev-dependabot/npm_and_yarn/tiptap/extension-text-align-3.19.0
- dev-dependabot/npm_and_yarn/tiptap/extension-floating-menu-3.19.0
- dev-dependabot/npm_and_yarn/tiptap/extension-character-count-3.19.0
This package is auto-updated.
Last update: 2026-03-16 09:40:47 UTC
README
A powerful form builder package for Laravel and Accelade. Create dynamic forms with a Filament-compatible API using Blade components.
Installation
composer require accelade/forms
The package will auto-register its service provider.
Quick Start
use Accelade\Forms\Form;
use Accelade\Forms\Components\TextInput;
use Accelade\Forms\Components\Select;
use Accelade\Forms\Components\Toggle;
$form = Form::make()
->action('/users')
->schema([
TextInput::make('name')
->label('Full Name')
->required()
->placeholder('Enter your name'),
TextInput::make('email')
->email()
->required(),
Select::make('role')
->options([
'admin' => 'Administrator',
'editor' => 'Editor',
'viewer' => 'Viewer',
])
->searchable(),
Toggle::make('active')
->label('Active Status'),
]);
Available Components
Text Inputs
- TextInput - Text, email, password, URL, tel, and numeric inputs
- Textarea - Multi-line text input with autosize support
- Hidden - Hidden form fields
Selection
- Select - Dropdown select with searchable, multiple, and remote options
- CheckboxList - Multiple checkbox selection with grid layout
- Radio - Radio button groups
- Checkbox - Single checkbox
- Toggle - Toggle switch
- ToggleButtons - Button-style toggle group
Rich Content
- RichEditor - WYSIWYG editor with toolbar customization
- TipTapEditor - TipTap-based editor with collaboration support
- MarkdownEditor - Markdown editing with preview
Specialized
- FileUpload - File uploads with FilePond integration
- IconPicker - Icon selection from multiple icon sets
- ColorPicker - Color selection with presets
- DatePicker / TimePicker / DateTimePicker - Date/time selection
- DateRangePicker - Date range selection
- TagsInput - Tag input with suggestions
- EmojiInput - Emoji picker
- PinInput - PIN/OTP code input
- RateInput - Star rating input
- Slider - Range slider input
- NumberField - Numeric input with increment/decrement
- KeyValue - Key-value pair editor
- Repeater - Repeatable field groups
Layout
- Group - Group fields together
Component Examples
TextInput
TextInput::make('username')
->label('Username')
->placeholder('Enter username')
->required()
->minLength(3)
->maxLength(20)
->prefix('@')
->hint('Your unique identifier');
// Email input
TextInput::make('email')->email()->required();
// Password input
TextInput::make('password')->password()->required();
// With date picker
TextInput::make('birthday')
->datePicker()
->format('Y-m-d');
Select
// Basic select
Select::make('country')
->options([
'us' => 'United States',
'uk' => 'United Kingdom',
'ca' => 'Canada',
])
->searchable();
// Multiple selection
Select::make('tags')
->multiple()
->options($tags);
// With Choices.js styling
Select::make('category')
->choices(['searchEnabled' => true])
->options($categories);
// Remote options
Select::make('user')
->remoteUrl('/api/users')
->remoteRoot('data')
->optionLabel('name')
->optionValue('id');
// With relationship
Select::make('roles')
->relation('roles')
->multiple();
FileUpload
// Image upload
FileUpload::make('avatar')
->image()
->maxSize(2048)
->disk('public')
->directory('avatars');
// Multiple files
FileUpload::make('documents')
->multiple()
->maxFiles(5)
->acceptedFileTypes(['application/pdf', 'image/*'])
->downloadable();
// With FilePond
FileUpload::make('photos')
->filepond(['allowImagePreview' => true])
->multiple();
// With Spatie Media Library
FileUpload::make('gallery')
->collection('gallery')
->mediaBrowser();
CheckboxList
CheckboxList::make('permissions')
->options([
'create' => 'Create',
'read' => 'Read',
'update' => 'Update',
'delete' => 'Delete',
])
->columns(2)
->bulkToggleable()
->descriptions([
'create' => 'Ability to create new records',
'delete' => 'Ability to delete records',
]);
RichEditor
RichEditor::make('content')
->toolbarButtons([
'bold', 'italic', 'underline',
'|',
'bulletList', 'orderedList',
'|',
'link', 'attachFiles',
])
->fileAttachmentsDisk('public')
->fileAttachmentsDirectory('uploads');
IconPicker
IconPicker::make('icon')
->sets(['emoji', 'heroicons'])
->defaultSet('heroicons')
->searchable()
->gridColumns(10);
// With Blade Icons
IconPicker::make('icon')
->bladeIcons()
->perPage(50);
Form Configuration
Form::make()
->action('/submit')
->method('POST')
->hasFiles() // Enable file uploads
->confirm('Are you sure?')
->confirmButtonText('Yes, submit')
->cancelButtonText('Cancel')
->stayOnPage() // Don't redirect after submit
->preserveScroll()
->resetOnSuccess()
->submitOnChange() // Auto-submit on field change
->debounce(500)
->schema([...]);
Validation
Validation rules are automatically extracted from field definitions:
TextInput::make('email')
->email()
->required()
->rules(['unique:users,email']);
You can also use Form Request validation alongside component rules.
Documentation
Detailed documentation for each component is available in the docs directory:
Getting Started
- Getting Started - Installation and basic usage
- API Reference - Complete API documentation
Form Components
Text Inputs
- Text Input - Text, email, password, URL inputs
- Textarea - Multi-line text with autosize
- Number Field - Numeric input with controls
Selection Components
- Select - Dropdown with search, multiple, remote options
- Checkbox - Single checkbox
- Checkbox List - Multiple checkbox selection
- Radio - Radio button groups
- Toggle - Toggle switch
- Toggle Buttons - Button-style toggles
Rich Content Editors
- Rich Editor - WYSIWYG editor
- TipTap Editor - TipTap-based editor
- Markdown Editor - Markdown with preview
Date & Time
- Date Picker - Date selection
- Time Picker - Time selection
- DateTime Picker - Combined date/time
- Date Range Picker - Date range selection
Specialized Inputs
- File Upload - File uploads with FilePond
- Icon Picker - Icon selection
- Color Picker - Color selection
- Tags Input - Tag input with suggestions
- Pin Input - PIN/OTP code input
- Rate Input - Star rating
- Slider - Range slider
- Key Value - Key-value pair editor
- Repeater - Repeatable field groups
Configuration
Publish the config file:
php artisan vendor:publish --tag=forms-config
Requirements
- PHP 8.2+
- Laravel 11.0+ or 12.0+
- Accelade core package
Testing
composer test
License
MIT License. See LICENSE for details.