Skip to content

Commit 17838da

Browse files
committed
minor #2664 [Icons] Improve setup instructions (dbu)
This PR was merged into the 2.x branch. Discussion ---------- [Icons] Improve setup instructions | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | yes | Issues | https://symfony-devs.slack.com/archives/C01FN4EQNLX/p1743272426739939 | License | MIT i missed that i need the http-client installed, the bundle silently reduces functionality without it. i try to make it more clear what needs to be installed by mentioning the optional dependencies in the installation section, and by moving the http client hint to the "icon sets" section rather than having it in the middle of the syntax how to render icons. Commits ------- 3d88215 improve setup instructions
2 parents 2a6c2dc + 3d88215 commit 17838da

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

src/Icons/doc/index.rst

+19-10
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ Installation
1616
1717
$ composer require symfony/ux-icons
1818
19+
HTTP Client for On-Demand Icons
20+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21+
22+
If you plan to use provided icon sets, make sure that you have the HTTP client installed:
23+
24+
.. code-block:: terminal
25+
26+
$ composer require symfony/http-client
27+
1928
SVG Icons
2029
---------
2130

@@ -63,15 +72,6 @@ Loading Icons
6372
and embeds the downloaded SVG contents in the template #}
6473
{{ ux_icon('flowbite:user-solid') }}
6574
66-
.. note::
67-
68-
To search and download icons via `ux.symfony.com/icons`_, the ``symfony/http-client``
69-
package must be installed in your application:
70-
71-
.. code-block:: terminal
72-
73-
$ composer require symfony/http-client
74-
7575
The ``ux_icon()`` function defines a second optional argument where you can
7676
define the HTML attributes added to the ``<svg>`` element:
7777

@@ -87,6 +87,15 @@ define the HTML attributes added to the ``<svg>`` element:
8787
Icon Sets
8888
~~~~~~~~~
8989

90+
.. note::
91+
92+
To use icons from icon sets via `ux.symfony.com/icons`_, the ``symfony/http-client``
93+
package must be installed in your application:
94+
95+
.. code-block:: terminal
96+
97+
$ composer require symfony/http-client
98+
9099
There are many icon sets available, each with their own unique style and set of
91100
icons, providing a wide range of icons for different purposes, while maintaining
92101
a consistent look and feel across your application. Here are some of the most
@@ -166,7 +175,7 @@ HTML Syntax
166175

167176
In addition to the ``ux_icon()`` function explained in the previous sections,
168177
this package also supports an alternative HTML syntax based on the ``<twig:ux:icon>``
169-
tag:
178+
tag if the ``symfony/ux-twig-component`` package is installed:
170179

171180
.. code-block:: html
172181

0 commit comments

Comments
 (0)