{"slug":"ux-toolkit","title":"ux-toolkit","summary":"Symfony UX Toolkit: install editable Twig buttons, dialogs and forms from Shadcn UI, Flowbite or Bootstrap kits. Use for ux:install, --kit, recipe dependencies, CSS setup, copied TwigComponents and Stimulus controllers, ux_toolkit configuration and custom kits.","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-12-02T16:48:39.721923Z","repo":{"url":"https://github.com/smnandre/symfony-ux-skills","stars":191,"forks":15,"license":"MIT","updatedAt":"2026-12-02T03:34:06Z"},"bodyHtml":"<hr>\n<h2>name: ux-toolkit\ndescription: 'Symfony UX Toolkit: install editable Twig buttons, dialogs and forms from Shadcn UI, Flowbite or Bootstrap kits. Use for ux:install, --kit, recipe dependencies, CSS setup, copied TwigComponents and Stimulus controllers, ux_toolkit configuration and custom kits.'\nlicense: MIT\nmetadata:\nauthor: Simon André\nurl: <a href=\"https://smnandre.dev\">https://smnandre.dev</a></h2>\n<h1>UX Toolkit</h1>\n<p>Install UI components the way Shadcn UI does: <code>ux:install</code> copies a recipe's Twig components and Stimulus controllers into your project, and from then on the code is yours to edit. Nothing stays in <code>vendor/</code>: the code, and its updates, are yours.</p>\n<p>Since Symfony UX 3.7+, the Toolkit follows the Symfony BC promise for the <code>ux:install</code> arguments and options, the <code>ux_toolkit</code> configuration and the manifest format. Recipe content itself can change between versions.</p>\n<h2>Installation</h2>\n<pre><code>composer require --dev symfony/ux-toolkit\n</code></pre>\n<p>The package only registers console commands: rendering never needs it, only installing recipes does. The installed components rely on TwigComponent and, for the interactive ones, on StimulusBundle.</p>\n<h2>Quick Reference</h2>\n<pre><code>php bin/console ux:install                          Pick a kit, then a recipe, interactively\nphp bin/console ux:install button --kit=shadcn      Install one recipe from one kit\nphp bin/console ux:install dialog -k shadcn -f      Overwrite changed files without asking\n--kit=github.com/acme/ui-kit:v1.2                   A community kit from a GitHub repository root\n</code></pre>\n<table>\n<thead>\n<tr>\n<th>Kit (<code>--kit</code>)</th>\n<th>Styling</th>\n<th>Recipes</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>shadcn</code></td>\n<td>Tailwind CSS 4, Shadcn UI \"Nova\"</td>\n<td>64 components, 26 blocks (login, signup, sidebar)</td>\n</tr>\n<tr>\n<td><code>flowbite-4</code></td>\n<td>Tailwind CSS 4, Flowbite v4</td>\n<td>22 components</td>\n</tr>\n<tr>\n<td><code>bootstrap</code></td>\n<td>Bootstrap 5.3</td>\n<td>25 components</td>\n</tr>\n<tr>\n<td><code>common</code></td>\n<td>Unstyled helpers</td>\n<td>7 components (clipboard, post-link, logout-link...)</td>\n</tr>\n</tbody>\n</table>\n<p>Full recipe lists and the CSS setup of each kit: <a href=\"references/kits.md\">references/kits.md</a>.</p>\n<h2>Installing a Recipe</h2>\n<pre><code>php bin/console ux:install dialog --kit=shadcn\n</code></pre>\n<ol>\n<li>The recipe and its recipe dependencies are copied (<code>dialog</code> also installs <code>button</code>): Twig files to <code>templates/components/</code>, controllers to <code>assets/controllers/</code>.</li>\n<li>An identical existing file is skipped. A changed file prompts for overwrite, after a <code>git diff</code> when git is available; <code>--force</code> overwrites.</li>\n<li>A \"Next steps\" section lists the packages to install. <strong>The command installs none of them</strong>: run the printed <code>composer require ...</code> and <code>importmap:require ...</code> (or <code>npm install ...</code>) yourself. It always lists the kit's global packages, even when they are already installed.</li>\n</ol>\n<p>Run it from the project root: files go to <code>--destination</code>, which defaults to the current directory. In a non-interactive shell, pass both the recipe and <code>--kit</code>, and add <code>--force</code> to replace changed files (they are skipped otherwise).</p>\n<h2>Kit Setup (once per project)</h2>\n<p>Each kit needs its CSS foundation before the first recipe looks right. For Shadcn UI with AssetMapper and the TailwindBundle:</p>\n<pre><code>php bin/console importmap:require shadcn/dist/tailwind.css tw-animate-css/dist/tw-animate.css\ncomposer require twig/extra-bundle twig/html-extra tales-from-a-dev/twig-tailwind-extra symfony/ux-icons\n</code></pre>\n<pre><code>/* assets/styles/app.css */\n@import 'tailwindcss';\n@import '../vendor/tw-animate-css/dist/tw-animate.css';\n@import '../vendor/shadcn/dist/tailwind.css';\n\n@custom-variant dark (&amp;:is(.dark *));\n\n/* + the @theme inline mapping, the :root and .dark color variables,\n   and the @layer base rules from the kit's INSTALL.md */\n</code></pre>\n<p>Copy the theme block from <code>kits/shadcn/INSTALL.md</code> or the <a href=\"https://ux.symfony.com/toolkit/kits/shadcn\">Shadcn UI kit page</a>. The block defines the tokens used by the recipes, including <code>--background</code>, <code>--primary</code> and <code>--radius</code>. For the other kits, see the <a href=\"references/kits.md\">Flowbite and Bootstrap setup</a>.</p>\n<h2>Using the Components</h2>\n<p>Recipes are anonymous TwigComponents with props declared in <code>{% props %}</code> and variants built with <code>html_cva</code>:</p>\n<pre><code>&lt;twig:Button&gt;Save&lt;/twig:Button&gt;\n&lt;twig:Button variant=\"outline\" size=\"sm\"&gt;Cancel&lt;/twig:Button&gt;\n&lt;twig:Button as=\"a\" href=\"{{ path('app_home') }}\" variant=\"link\"&gt;Home&lt;/twig:Button&gt;\n&lt;twig:Button variant=\"ghost\" size=\"icon\" aria-label=\"Delete\"&gt;\n    &lt;twig:ux:icon name=\"lucide:trash-2\" /&gt;\n&lt;/twig:Button&gt;\n</code></pre>\n<p>Classes you pass merge with the variant classes through <code>tailwind_classes</code>, and yours win on conflict (<code>class=\"rounded-full\"</code> replaces the default radius).</p>\n<p>Compound components share state with <code>provide()</code> / <code>inject()</code>. Triggers expose an attribute set to spread on your own element:</p>\n<pre><code>&lt;twig:Dialog id=\"delete_account\"&gt;\n    &lt;twig:Dialog:Trigger&gt;\n        &lt;twig:Button variant=\"destructive\" {{ ...dialog_trigger_attrs }}&gt;Delete account&lt;/twig:Button&gt;\n    &lt;/twig:Dialog:Trigger&gt;\n    &lt;twig:Dialog:Content&gt;\n        &lt;twig:Dialog:Header&gt;\n            &lt;twig:Dialog:Title&gt;Are you absolutely sure?&lt;/twig:Dialog:Title&gt;\n            &lt;twig:Dialog:Description&gt;This cannot be undone.&lt;/twig:Dialog:Description&gt;\n        &lt;/twig:Dialog:Header&gt;\n        &lt;twig:Dialog:Footer&gt;\n            &lt;twig:Dialog:Close&gt;\n                &lt;twig:Button variant=\"outline\" {{ ...dialog_close_attrs }}&gt;Cancel&lt;/twig:Button&gt;\n            &lt;/twig:Dialog:Close&gt;\n        &lt;/twig:Dialog:Footer&gt;\n    &lt;/twig:Dialog:Content&gt;\n&lt;/twig:Dialog&gt;\n</code></pre>\n<p>The same pattern gives <code>alert_dialog_trigger_attrs</code>, <code>tooltip_trigger_attrs</code> and <code>modal_trigger_attrs</code> (Flowbite). Each recipe's README, and its page on ux.symfony.com, lists the props and examples.</p>\n<h2>Configuration</h2>\n<p>Since Symfony UX 3.7+, choose where files go, and optionally namespace them:</p>\n<pre><code># config/packages/ux_toolkit.yaml\nwhen@dev:\n    ux_toolkit:\n        components:\n            dir: 'templates/components'   # TwigComponent anonymous template directory\n            subdirectory: 'ui'            # components become &lt;twig:ui:Button&gt;\n        controllers:\n            dir: 'assets/controllers'     # must match your Stimulus controller path\n            subdirectory: 'ui'            # identifiers become ui--dialog\n</code></pre>\n<p>The installer rewrites component names and Stimulus identifiers in the copied files to match. Both <code>dir</code> values must match your Twig, TwigComponent and Stimulus configuration, so that the installed files get loaded. Keep the file under <code>when@dev</code> when the bundle is only enabled in dev.</p>\n<h2>Custom Kits</h2>\n<p>A kit is a folder (or a GitHub repository root) with a <code>manifest.json</code> and one folder per recipe. Install from GitHub with <code>--kit=github.com/acme/ui-kit</code> (<code>:ref</code> for a tag or branch; <code>main</code> by default; needs <code>symfony/http-client</code> and <code>ext-zip</code>).</p>\n<pre><code>vendor/bin/ux-toolkit-kit-create    # scaffold manifest.json and a Button recipe\nvendor/bin/ux-toolkit-kit-lint      # validate the kit (--fail-on-warning for CI)\nvendor/bin/ux-toolkit-kit-debug     # list each recipe's files and dependencies\n</code></pre>\n<p>Manifest keys, placeholders and naming rules: <a href=\"references/kits.md#custom-kits\">references/kits.md</a>.</p>\n<h2>Gotchas</h2>\n<ul>\n<li>The recipe name you install is its <strong>folder name</strong> (<code>login-01</code>, <code>logout-link</code>); the manifest <code>name</code> (\"LoginForm\") is only a label.</li>\n<li>Re-running <code>ux:install</code> is the only upgrade path: read the diff for each changed file, since your edits live in the same files.</li>\n<li>Shadcn recipes use <code>lucide:</code> icons through UX Icons: install <code>symfony/ux-icons</code> and lock icons before deploying (see ux-icons).</li>\n<li>Interactive recipes import <code>@hotwired/stimulus</code>: although no recipe lists it, StimulusBundle must be set up.</li>\n<li>On Tailwind 4, buttons default to <code>cursor: default</code>: add <code>button:not(:disabled) { cursor: pointer; }</code> to your base layer if you want the pointer.</li>\n</ul>\n<h2>References</h2>\n<ul>\n<li><a href=\"https://ux.symfony.com/toolkit\">Symfony UX package page</a> (<a href=\"https://ux.symfony.com/toolkit.md\">Markdown summary</a>) · <a href=\"https://packagist.org/packages/symfony/ux-toolkit\"><code>symfony/ux-toolkit</code> on Packagist</a>.</li>\n<li>Try the <a href=\"https://ux.symfony.com/toolkit#demo\">Toolkit component demo</a>.</li>\n<li>The <a href=\"https://ux.symfony.com/kits\">UI kit catalog</a> links to the recipe previews for <a href=\"https://ux.symfony.com/toolkit/kits/bootstrap\">Bootstrap</a>, <a href=\"https://ux.symfony.com/toolkit/kits/common\">Common</a>, <a href=\"https://ux.symfony.com/toolkit/kits/daisyui-5\">daisyUI</a>, <a href=\"https://ux.symfony.com/toolkit/kits/flowbite-4\">Flowbite</a> and <a href=\"https://ux.symfony.com/toolkit/kits/shadcn\">Shadcn UI</a>.</li>\n<li>For installing recipes, choosing kits and configuring target paths, see the <a href=\"https://symfony.com/bundles/ux-toolkit\">Symfony UX Toolkit documentation</a>.</li>\n<li><strong>Kits</strong> (recipe lists, per-kit CSS setup, helper packages, manifest format, custom kits): <a href=\"references/kits.md\">references/kits.md</a></li>\n</ul>\n<h2>See Also</h2>\n<ul>\n<li><strong>twig-component</strong>: props, blocks, <code>attributes</code>, <code>html_cva</code>, <code>provide()</code> / <code>inject()</code> behind every recipe</li>\n<li><strong>stimulus</strong>: the controllers recipes install</li>\n<li><strong>ux-icons</strong>: icons used by the Shadcn UI and Flowbite recipes</li>\n</ul>\n","files":[{"path":"references/kits.md","sizeBytes":9438,"isText":true},{"path":"SKILL.md","sizeBytes":8855,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-12-02T16:49:29.990979Z","sha256":"4597635E28D1C298CC30259333F89899EC65F69A659C5E44E13C3CF6001950A4","sizeBytes":7610},"review":null,"source":{"repositoryUrl":"https://github.com/smnandre/symfony-ux-skills","path":"skills/ux-toolkit","license":"MIT","commit":"78c25ed0b79bcc21d7611002dc81d8b87c3316e2","subtreeSha":"1CE8EE38C39ED2E2BA2AA26578C6EFCC1DEA11BB9730DD8FEBF341C7849490C8","lastSyncedAt":"2026-12-02T16:48:36.132977Z"},"reviewedAt":"2026-12-02T16:51:15.423322Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/smnandre/symfony-ux-skills/tree/main/skills/ux-toolkit"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install smnandre-symfony-ux-skills@llmmart"},{"target":"git","command":"git clone https://github.com/smnandre/symfony-ux-skills.git"}]}