Download the PHP package ducrot/twigcn-bundle without Composer

On this page you can find all versions of the php package ducrot/twigcn-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package twigcn-bundle

TwigcnBundle

CI Packagist

Read-only mirror. This repository is a subtree split of ducrot/twigcn and exists so Composer/Packagist can ship the bundle. Issues and pull requests are intentionally disabled here — please open them in the main repository.

Beautiful, accessible UI components for Symfony & Twig. Inspired by shadcn/ui, built for Symfony.

Requirements

Installation

Step 1: Install the PHP Bundle

The bundle registers automatically via Symfony Flex.

Step 2: Install the NPM Package

If your project uses AssetMapper (the Symfony 7.x webapp default), also expose the package to the importmap so it can be imported from JavaScript:

Webpack Encore projects pick up node_modules automatically and do not need this step.

Step 3: Configure Your CSS

Tailwind processes a source file into a static stylesheet. Keep the source out of assets/ (so AssetMapper does not also serve it raw) — for example tailwind.css at the project root:

Then build with the Tailwind CLI (Symfony does not bundle CSS itself):

The compiled output at assets/styles/app.css is what AssetMapper or Encore serves. Re-run the build whenever templates or styles change (or use --watch during development).

Step 4: Register Stimulus Controllers

Option A: Automatic (Symfony UX)

Create or update assets/controllers.json:

Option B: Manual Registration

In a Symfony project that uses StimulusBundle (the default in the webapp recipe), register the controllers on the existing Stimulus application from assets/bootstrap.js (or assets/stimulus_bootstrap.js) — do not start a second one:

For non-Symfony or fully custom Stimulus setups (e.g. Webpack Encore without StimulusBundle):

Alternative: Vite via pentatrion/vite-bundle

For projects that prefer a real bundler (recommended for Tailwind + TypeScript

Install (replaces Steps 2–4 above):

vite.config.ts:

assets/app.ts:

assets/app.css:

In your base Twig template:

Then npm run dev for HMR or npm run build for production. The bundle's config/packages/pentatrion_vite.yaml in the demo shows the minimal Symfony-side configuration.

Usage

Components are namespaced under Twigcn: in Twig (Symfony UX TwigComponent prefixes third-party bundle components with their bundle namespace):

Available Components

Form

Layout

Overlay

Feedback

Naming Notes

A few PHP class names differ from their Twig component tag because the tag name is reserved or already taken in PHP:

Twig tag PHP class
<twig:Twigcn:Empty> EmptyState
<twig:Twigcn:Switch> SwitchComponent
<twig:Twigcn:Field> FieldForm

Theming

Components use CSS custom properties for theming. Override these in your CSS:

Dark Mode

Toggle dark mode by adding/removing the dark class on the <html> element:

Or manually:

Contributing & Issues

Development happens in ducrot/twigcn. Open issues at https://github.com/ducrot/twigcn/issues and pull requests against the same repo. Release notes are tracked in the monorepo's CHANGELOG.

License

MIT License


All versions of twigcn-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
symfony/config Version ^7.0
symfony/dependency-injection Version ^7.0
symfony/http-kernel Version ^7.0
symfony/ux-twig-component Version ^2.18
symfony/ux-icons Version ^2.18
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ducrot/twigcn-bundle contains the following files

Loading the files please wait ...