x
1
2
3
4
5
6
7
8
9
10
<button type="button" class="elevate-button elevate-button--primary elevate-button--size-xl elevate-button--align-center"> <span class="elevate-button--leading-visual"> <span class="elevate-icon elevate-icon--scheme--white elevate-icon--size--s"> <svg viewbox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" fill="currentColor" focusable="false" aria-hidden="true"> <path d="M17 9h-11.586l3.293-3.293a.999.999 0 1 0-1.414-1.414l-5 5a.999.999 0 0 0 0 1.414l5 5a.997.997 0 0 0 1.414 0 .999.999 0 0 0 0-1.414l-3.293-3.293h11.586a1 1 0 1 0 0-2z"></path> </svg> </span> </span> Button</button>1
2
3
4
<%= elevate_button(scheme: :primary, size: :extra_large) do |component| %> <% component.with_leading_visual_icon(name: 'arrow-left-minor', scheme: :white) %> Button<% end %>No notes provided.
No params configured.
app/assets/stylesheets/components/button.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@layer components { .elevate-button { @apply rounded font-semibold; } /* SCHEME */ .elevate-button.elevate-button--default { @apply bg-white ring-1 text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 shadow-sm; } .elevate-button.elevate-button--primary { @apply bg-primary-700 text-white hover:bg-primary-800 shadow-sm; } .elevate-button.elevate-button--secondary { @apply bg-white text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 shadow-sm; } .elevate-button.elevate-button--danger { @apply bg-red-500 text-white shadow-sm hover:bg-red-400; } .elevate-button.elevate-button--soft { @apply bg-indigo-50 text-indigo-600 shadow-sm hover:bg-indigo-100; } .elevate-button.elevate-button--link { @apply bg-white hover:bg-gray-100 text-gray-900; } .elevate-button.elevate-button--transparent { /* No specific style, transparent button */ } /* SIZES */ .elevate-button.elevate-button--size-xs { @apply text-xs px-2 py-1; } .elevate-button.elevate-button--size-s { @apply text-sm px-2 py-1; } .elevate-button.elevate-button--size-l { @apply text-sm px-2.5 py-1.5; } .elevate-button.elevate-button--size-xl { @apply text-sm px-3 py-2; } .elevate-button.elevate-button--size-xxl { @apply text-sm px-3.5 py-2.5; } /* Align content */ .elevate-button.elevate-button--align-start { @apply flex items-center justify-start; } .elevate-button.elevate-button--align-center { @apply flex items-center justify-center; } .elevate-button.elevate-button--align-end { @apply flex items-center justify-end; } /* Disabled */ .elevate-button.elevate-button--disabled { @apply opacity-50 cursor-not-allowed; } /* loading */ .elevate-button.elevate-button--loading { } /* Full width */ .elevate-button.elevate-button--full-width { @apply w-full; } /* Leading visual */ .elevate-button .elevate-button--leading-visual { @apply mr-2; } /* Trailing visual */ .elevate-button .elevate-button--trailing-visual { } /* Trailing action */ .elevate-button .elevate-button--trailing-action { @apply ml-2; }}