You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pages/components/button.md
+52-2Lines changed: 52 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,9 @@ description: Button component of Sloth.css.
5
5
6
6
## Button
7
7
8
-
Buttons indicate actions the user can trigger on click. Buttons already have a base styling via the drop-in core of Sloth.css. However, this CSS component extends those by several color variations and button groups.
8
+
Buttons indicate actions the user can trigger on click. Buttons already have a base styling via the drop-in core of Sloth.css. However, this CSS component extends those by several variations, sizes, groups and more.
9
9
10
-
### Color variants
10
+
### Button variants
11
11
12
12
The default button without any class is already utilizing accent coloring. In addition, you can use `neutral`, `success` and `alert` classes for the corresponding colors.
13
13
@@ -41,6 +41,22 @@ Using the `disabled` attribute deactivates buttons. If you're using `onclick` ev
Use the `sm` or `lg` classes to reduce or increase the font size and padding of a button. Note that the actual width and height are still depending on the buttons content (content won't overflow the button but stretch it).
For less important buttons with outline and transparent backgrounds, the `hollow` class can be used. It can be combined with all other button related classes.
@@ -121,6 +137,40 @@ Use the `ghost` class to keep button sizing without background color or border.
121
137
<aclass="ghost button"href="#">GitHub</a>
122
138
```
123
139
140
+
### Icon button
141
+
142
+
Sloth.css doesn't ship any icons, since there are lots of icon libraries out there. However SVG icons are directly supported using the `icon` class. Buttons are set to _inline-flex_ per default, so multiple elements inside buttons are nicely aligned next to each other.
143
+
144
+
The beautiful <ahref="https://tabler.io/icons"target="_blank">Tabler Icons</a> work well with Sloth.css for example. You can also create icon buttons without any text. You might want to use the `rounded-full` utility for those.
Use the `busy` class to replace the text of a button with a <ahref="/components/loader">loader</a> while keeping the button size. Works with secondary buttons, link buttons and pill buttons. Busy buttons are disabled.
0 commit comments