Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Ux Autocomplete

Ux Autocomplete Laravel Package

symfony/ux-autocomplete

Symfony UX Autocomplete adds JavaScript-powered autocomplete to Symfony forms, letting users search and select options as they type with minimal setup and seamless form integration.

View on GitHub
Deep Wiki
Context7

Symfony UX Autocomplete adds JavaScript-powered autocompletion to your Symfony forms. It upgrades standard ChoiceType and EntityType fields into searchable, AJAX-driven inputs—no custom JavaScript required. Just enable the UX bundle and your forms become instantly more usable.

  • Entity autocompletion via AutocompleteField with server-side AJAX loading
  • Tom Select powered frontend for fast, accessible search
  • Dynamic options loaded on demand, ideal for large datasets
  • Symfony form integration with simple PHP field types
  • Customizable behavior, labels, and minimum search length

Part of the Symfony UX ecosystem, backed by Mercure.rocks.

Frequently asked questions about Ux Autocomplete
What is symfony/ux-autocomplete used for?
It adds JavaScript-powered autocomplete to Symfony forms using Tom Select and a Stimulus controller. It supports Doctrine entity fields and AJAX-loaded options from custom endpoints. It is a Symfony UX package, not a Laravel package, so Laravel teams should treat it as a reference or use Tom Select directly.
Can I use symfony/ux-autocomplete in Laravel?
No, it is built for Symfony Forms, Stimulus, routing, and asset mapper, so it is not a drop-in Composer package for Laravel. Laravel uses Blade, Livewire, and different form and asset stacks. For Laravel, integrate Tom Select or Choices.js manually or use a Laravel-compatible autocomplete package.
How do I install symfony/ux-autocomplete?
Install it with Composer using composer require symfony/ux-autocomplete, then enable the bundle if your app does not use Symfony Flex. Load its CSS and JavaScript through Symfony asset mapper or your asset pipeline, and make sure the Stimulus controller is registered. Confirm you meet the Symfony and PHP version requirements first.
Which Symfony and PHP versions does symfony/ux-autocomplete support?
Version 3.x requires Symfony 7.4 or newer and PHP 8.4 or newer. Version 2.x supports Symfony 6.4 or newer and PHP 8.2 or newer. Check the changelog before pinning an older release, and plan upgrade work if your application is on an older Symfony version.
How do I load AJAX options from a custom endpoint with symfony/ux-autocomplete?
Create a Symfony controller route that returns JSON results, then configure your form field to use that route with the autocomplete field options. Use max_results and pagination for large result sets, and validate the search term before querying. For Doctrine entities, the AsEntityAutocompleteField trait and base entity autocomplete type reduce custom controller code.
Is symfony/ux-autocomplete secure against XSS?
HTML escaping is enabled by default in recent releases, and a critical XSS issue was fixed in v2.36 and later, so keep the package updated. Audit any custom autocomplete endpoints for output escaping, input validation, and CSRF protection where appropriate. Do not expose sensitive fields in AJAX result labels without masking.
How does symfony/ux-autocomplete perform with large datasets?
Use max_results and pagination to avoid loading too many rows per search request. Entity-based autocomplete uses Doctrine queries, so index the searched columns and limit expensive LIKE or join queries. For 10K+ records, test endpoint latency and consider a custom endpoint or search service such as Elasticsearch for complex filtering.
Do I need Stimulus and asset mapper to use symfony/ux-autocomplete?
Yes, the package ships a Stimulus controller, so Symfony UX Stimulus setup is expected. You also need a way to load its JavaScript and CSS, such as Symfony asset mapper or Webpack Encore. Without Stimulus, you would need to wire Tom Select manually and lose the package's default integration.
What are alternatives to symfony/ux-autocomplete?
Alternatives include integrating Tom Select or Choices.js manually, using Symfony UX LiveComponents for dynamic forms, or relying on API Platform or Elasticsearch-backed search endpoints. Laravel developers often compare Laravel Choices.js packages or manual Tom Select setup. Choose based on existing Symfony UX adoption, maintenance, and XSS handling.
How do I test autocomplete fields in a Symfony application?
Test form types and autocomplete endpoint responses with Symfony WebTestCase or KernelBrowser, asserting JSON shape, filtering, and access control. Add browser or JavaScript tests for Stimulus and Tom Select behavior. Also test invalid input, CSRF behavior where used, and empty-result responses.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections