accelade / forms
Form builder components for Accelade - create dynamic forms with text inputs, selects, checkboxes, and more
Fund package maintenance!
fadymondy
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/accelade/forms
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
This package is auto-updated.
Last update: 2026-01-18 13:41:23 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.