A Symfony bundle that provides partial form theme for DaisyUI components.
- ✅ 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
- 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...
composer require islesurlasorguetourisme/daisyui-form-bundleIf you're using Symfony Flex, the bundle is automatically enabled. Otherwise, add it to config/bundles.php:
return [
// ...
Islesurlasorguetourisme\DaisyuiFormBundle\DaisyuiFormBundle::class => ['all' => true],
];Add the form theme to your config/packages/twig.yaml:
twig:
form_themes:
- '@DaisyuiForm/form/daisyui_layout.html.twig'Make sure you have DaisyUI and Tailwind CSS properly configured in your project:
npm install -D daisyui@lateststyle.css
@import "tailwindcss";
@plugin "daisyui";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.
To use the DaisyUI theme for a specific form:
{% form_theme form '@DaisyuiForm/form/daisyui_layout.html.twig' %}
{{ form(form) }}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 %}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
This bundle is released under the MIT License. See the LICENSE file for details.
- Developed and maintained by Isle sur la Sorgue Tourisme
- Built for Symfony
- Styled with DaisyUI
If you encounter any issues or have questions:
- Open an issue on GitHub
- Check the Symfony Form documentation
- Refer to DaisyUI documentation