islesurlasorguetourisme / daisyui-form-bundle
A Symfony form theme bundle that provides seamless DaisyUI integration for automatically generated forms
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Language:Twig
Type:symfony-bundle
pkg:composer/islesurlasorguetourisme/daisyui-form-bundle
Requires
- php: >=8.1
- symfony/http-kernel: ^6.4 || ^7.0
- symfony/twig-bridge: ^6.4 || ^7.0
Requires (Dev)
- phpunit/phpunit: ^9.5 || ^10.0
- symfony/form: ^6.4 || ^7.0
- symfony/intl: ^6.4 || ^7.0
- symfony/security-csrf: ^6.4 || ^7.0
- symfony/test-pack: ^1.0
- symfony/translation: ^6.4 || ^7.0
README
[WIP] DaisyUI Form Bundle
A Symfony bundle that provides partial form theme for DaisyUI components.
Features
- ✅ Partial DaisyUI component support - Form field types styled with DaisyUI classes
- 🎨 Tailwind CSS integration - Works seamlessly with Tailwind CSS utility classes
- 📱 Responsive design - Mobile-friendly form layouts out of the box
- ♿ Accessible - Maintains Symfony's accessibility features
Supported Form Types
- Text inputs, textareas, and all standard HTML5 input types
- Select dropdowns (with autocomplete support)
- Checkboxes and radio buttons
- Date, time, and datetime pickers
- Money and percent inputs
- File uploads
- Submit and reset buttons
- And more...
Installation
1. Install the bundle
composer require islesurlasorguetourisme/daisyui-form-bundle
2. Enable the bundle
If you're using Symfony Flex, the bundle is automatically enabled. Otherwise, add it to config/bundles.php:
return [ // ... Islesurlasorguetourisme\DaisyuiFormBundle\DaisyuiFormBundle::class => ['all' => true], ];
3. Configure the form theme
Add the form theme to your config/packages/twig.yaml:
twig: form_themes: - '@DaisyuiForm/form/daisyui_layout.html.twig'
4. Ensure DaisyUI is installed
Make sure you have DaisyUI and Tailwind CSS properly configured in your project:
npm install -D daisyui@latest
style.css
@import "tailwindcss"; @plugin "daisyui";
Usage
Once installed and configured, all your Symfony forms will automatically use DaisyUI styling:
// In your controller $form = $this->createFormBuilder() ->add('name', TextType::class) ->add('email', EmailType::class) ->add('message', TextareaType::class) ->add('send', SubmitType::class) ->getForm();
{# In your template #} {{ form(form) }}
That's it! Your form will be rendered with beautiful DaisyUI components.
Per-form theme override
To use the DaisyUI theme for a specific form:
{% form_theme form '@DaisyuiForm/form/daisyui_layout.html.twig' %}
{{ form(form) }}
Customization
Override specific blocks
Create your own form theme file and extend the DaisyUI theme:
{% extends '@DaisyuiForm/form/daisyui_layout.html.twig' %}
{% block form_row %}
{# Your custom form row markup #}
{{ parent() }}
{% endblock %}
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This bundle is released under the MIT License. See the LICENSE file for details.
Credits
- Developed and maintained by Isle sur la Sorgue Tourisme
- Built for Symfony
- Styled with DaisyUI
Support
If you encounter any issues or have questions:
- Open an issue on GitHub
- Check the Symfony Form documentation
- Refer to DaisyUI documentation