Skip to content

Commit 51d7883

Browse files
committed
[Toolkit] Fine-tune the documentation
1 parent 744b328 commit 51d7883

File tree

2 files changed

+59
-8
lines changed

2 files changed

+59
-8
lines changed

src/Toolkit/doc/index.rst

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,76 @@ Symfony UX Toolkit
44
**EXPERIMENTAL** This component is currently experimental and is likely
55
to change, or even change drastically.
66

7-
Symfony UX Toolkit provides a set of ready-to-use UI components for Symfony applications.
7+
Symfony UX Toolkit provides a set of ready-to-use Tailwind CSS based UI components for Symfony applications.
88
It is part of `the Symfony UX initiative`_.
99

10+
Please note that the **UX Toolkit is not a library of UI components**,
11+
but **a tool to help you build your own UI components**.
12+
It uses the same approach than the popular `Shadcn UI`_,
13+
and a similar approach than `Tailwind Plus`_.
14+
15+
After installing the UX Toolkit, you can start pulling the components you need
16+
from the `UX Components page`_, and use them in your project.
17+
They become your own components, and you can customize them as you want.
18+
19+
These UI components are based on `Twig Component`_ UX package, so we are sure
20+
to provide the best experience as possible to Symfony developers.
21+
22+
Additionally, the UI components come with `html_cva` and `tailwind_merge`,
23+
you can either remove them from your project or install `twig/html-extra`
24+
and `tales-from-a-dev/twig-tailwind-extra` to use them.
25+
26+
Also, we do not force you to use Tailwind CSS at all. If you want to use
27+
another CSS framework, you can, but you will need to adapt the UI components to it.
28+
1029
Installation
1130
------------
1231

13-
TODO
32+
Install the UX Toolkit using Composer and Symfony Flex:
33+
34+
.. code-block:: terminal
35+
36+
# The UX Toolkit is a development dependency:
37+
$ composer require symfony/ux-toolkit --dev
38+
39+
# If you want to to keep `html_cva` and `tailwind_merge` in your UI components:
40+
$ composer require twig/extra-bundle twig/html-extra:^3.12.0 tales-from-a-dev/twig-tailwind-extra
1441
1542
Configuration
1643
-------------
1744

1845
TODO
1946

47+
Usage
48+
-----
49+
50+
You may find a list of components in the `UX Components page`_, with the installation instructions for each of them.
51+
52+
For example, if you want to install the `Button` component, you will find the following instruction:
53+
54+
.. code-block:: terminal
55+
56+
$ bin/console ux:toolkit:install Button
57+
58+
It will create the ``templates/components/Button.html.twig`` file, and you will be able to use the `Button` component like this:
59+
60+
.. code-block:: html+twig
61+
62+
<twig:Button>Click me</twig:Button>
63+
2064
Backward Compatibility promise
2165
------------------------------
2266

2367
This bundle aims at following the same Backward Compatibility promise as
2468
the Symfony framework:
2569
https://symfony.com/doc/current/contributing/code/bc.html
2670

71+
However, the UI components and other files provided by the Toolkit **are not** covered by the Backward Compatibility
72+
promise.
73+
We may break them in patch or minor release, but you won't get impacted unless you re-install the same UI component.
74+
2775
.. _`the Symfony UX initiative`: https://ux.symfony.com/
28-
#.. _`Twig Component`: https://symfony.com/bundles/ux-twig-component/current/index.html
76+
.. _`Twig Component`: https://symfony.com/bundles/ux-twig-component/current/index.html
77+
.. _`UX Components page`: https://ux.symfony.com/components
78+
.. _`Shadcn UI`: https://ui.shadcn.com/
79+
.. _`Tailwind Plus`: https://tailwindcss.com/plus

ux.symfony.com/templates/ux_packages/toolkit.html.twig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@
101101
Official components require tailwindcss to be installed in your project. Visit the <a class="text-underline" target="_blank" href="https://tailwindcss.com/docs/installation" target="_blank">Tailwind CSS documentation</a> for more information.
102102
Components are based on <a class="text-underline" target="_blank" href="https://ui.shadcn.com/" >shadcdn/ui</a> design system.
103103
</p>
104-
104+
105105
<p class="mt-4">
106106
If you use component library using <code>html_cva()</code> or <code>tailwind_merge()</code> functions, remember to install them with:
107107
</p>
108108

109109
{% component Terminal with {bottomPadding: 20} %}
110110
{% block content %}
111-
composer require --dev tales-from-a-dev/twig-tailwind-extra twig/extra-bundle
111+
composer require twig/extra-bundle twig/html-extra:^3.12.0 tales-from-a-dev/twig-tailwind-extra
112112
{% endblock %}
113113
{% endcomponent %}
114114

@@ -122,13 +122,13 @@
122122
Toolkit provides ready-to-use components, but freely customizable.
123123
</p>
124124
<p>
125-
Official components are copied into your project in the <code>templates/components</code> folder, like classic TwigComponent.
125+
Official components are copied into your project in the <code>templates/components</code> folder, like classic TwigComponent.
126126
Feel free to modify the code to suit your needs.
127127
</p>
128128
</div>
129129
<div class="col-12 mt-4">
130130
<p>
131-
It is quite possible to install other component libraries, or even redistribute your own components
131+
It is quite possible to install other component libraries, or even redistribute your own components
132132
(for example, if you want to provide your internal Design System).
133133
</p>
134134
<p>
@@ -182,4 +182,4 @@
182182
border-radius: var(--radius-md);
183183
}
184184
</style>
185-
{% endblock %}
185+
{% endblock %}

0 commit comments

Comments
 (0)