Icon Buttons
Ce contenu n’est pas encore disponible dans votre langue.
You can add icons to your buttons using one of the following options.
SVG icon
link SVG iconUse a link wrapper
(Oxygen) or div
(Bricks), insert your SVG code using a code block
(Oxygen) or a code element
(Bricks). Add the o-btn
class to the container. OxyProps will take care of styling the SVG as the button icon.
CSS icon
link CSS iconStep 1
link Step 1Browse the icon library of your choice and copy the URL of the icon you want to use. In this example, we will use the Iconify library.
Once you have found your icon:
- Click the SVG button.
- Click the SVG as data: URI button.
- Click the copy button to copy the code to your clipboard.
Step 2
link Step 2Create a custom CSS rule in your global CSS using the following model. This way, you insert the SVG code once and can reuse it without duplication.
Step 3
link Step 3Add the icon to the button by inserting an element with the data-icon
attribute and the icon-name
value. This can be a span
or a div
element.