Buttons are used to make common actions immediately visible and easy to perform with one click, tap, or keypress. Users can use them to navigate or to take action.
<a href="#" class="ys-button ys-button--cta">
<span class="ys-button__text">Button Text</span>
</a>
<a href="#" class="ys-button">
<span class="ys-button__text">Button Text</span>
</a>
<a href="#" class="ys-button ys-button--light">
<span class="ys-button__text">Button Text</span>
</a>
<a href="#" class="ys-button ys-button--secondary-dark">
<span class="ys-button__text">Button Text</span>
</a>
<a href="#" class="ys-button ys-button--secondary-light">
<span class="ys-button__text">Button Text</span>
</a>
<a href="#" class="ys-button ys-button--tertiary-dark">
<span class="ys-button__text">Button Text</span>
</a>
<a href="#" class="ys-button ys-button--tertiary-light">
<span class="ys-button__text">Button Text</span>
</a>
All of the above can be include an icon, ie. the default button:
<a href="#" class="ys-button ys-button--icon">
<span class="ys-button__text">Button Text</span>
<span class="ys-button__icon" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" class="ys-icon">
<use xlink:href="/assets/svg/sprite/icons.svg#ys-icon-simple-arrow-right"></use>
</svg>
</span>
</a>
In some cases it makes sense to place the icon before the text (e.g. a back button) which is also supported.
All button colorways can be displayed with an icon only, ie. the default button:
<a href="#" class="ys-button ys-button--icon-only">
<span class="ys-button__text ys-u-visuallyhidden">Button Text</span>
<span class="ys-button__icon" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" class="ys-icon">
<use xlink:href="/assets/svg/sprite/icons.svg#ys-icon-simple-arrow-right"></use>
</svg>
</span>
</a>
Important: Never leave out the <span class="ys-button__text">
element, as this is included for accessibility purposes.
<a href="#" class="ys-button ys-button--block">
<span class="ys-button__text">Button Text</span>
</a>
<a href="#" class="ys-button ys-button--small">
<span class="ys-button__text">Button Text</span>
</a>
<a>
and <button>
elements are allowed to use the .ys-button
classtype
attribute when using a button
element. The default is submit
but in most cases you probably want to use type="button"
Use the HTML attribute disabled
as it will provide default browser behaviour and functionality.
If you can’t get the button to display an icon please read the HTML instructions under Components > Icons & Logo > Icon
The CTA button should only be used for the MAIN or IMPORTANT calls to action on a page.
Please be careful when using disabled buttons. Usability research shows that disabled buttons can confuse users: Disabled Buttons suck