The button classes can be used with <a>
, <button>
, or <input>
elements to provide
standardized styling regardless of element used.
As a best practice, we highly recommend using the <button>
or <a>
elements whenever
possible to ensure matching cross-browser rendering.
See variants section below
for style variations of color, border and disabled states.
<button class="button">
Button
</button>
<input type="submit" class="button" value="Button Input">
When using an anchor as a button, include a role="button"
attribute.
<a href="#" class="button" role="button">
Button Link
</a>
<p>
<button class="button button--blue">
Button (Blue)
</button></p>
<p>
<button class="button button--bright-blue">
Button (Bright Blue)
</button></p>
<p>
<button class="button button--orange">
Button (Orange)
</button></p>
The border variant can NOT be applied to <input>
elements.
<p>
<button class="button button--blue button--border">
Button
</button></p>
<p>
<a href="#" class="button button--orange button--border" role="button">
Button Link
</a></p>
For buttons that need to fit in tight places use the .button--compact
class.
<p>
<button class="button button--blue button--compact">
Button
</button></p>
<p>
<a href="#" class="button button--orange button--border button--compact" role="button">
Button Link
</a></p>
<p>
<button class="button button--blue" disabled>
Button
</button></p>
<p>
<input type="submit" class="button button--bright-blue" value="Button Input" disabled></p>
<p>
<a href="#" class="button button--orange button--disabled" role="button">
Button Link
</a></p>
Button with an icon to the right of the text. Add an empty span with the icon class
after the text. Also, use the data-grunticon-embed
attribute on that span so that
the proper color can be applied.
<p>
<button class="button button--blue">
Button <span class="icon-text-arrow-right" data-grunticon-embed></span>
</button></p>
<p>
<a href="#" class="button button--orange" role="button">
Button Link <span class="icon-text-arrow-right" data-grunticon-embed></span>
</a></p>
<p>
<a href="#" class="button button--blue button--loading" role="button">
Loading <span class="icon-circle-spin" data-grunticon-embed></span>
</a></p>