To create a button, add the GenshiButton class to a button:

<button type="button" class="GenshiButton">Click me</button>

However, if you want to use a button to change the browser URL, you can also add the GenshiButton class to a link. It is important to always remember the semantic distinction between using <a> and using <button>.

<a href="https://github.com/makigas/genshi" target="_blank" class="GenshiButton">
  Star repo on GitHub
</a>

Star repo on GitHub

Button sizes

Buttons come in a variety of sizes. Choose the one of your wish:

<button type="button" class="GenshiButton GenshiButton--xs">Extra small</button>
<button type="button" class="GenshiButton GenshiButton--sm">Small</button>
<button type="button" class="GenshiButton GenshiButton--md">Medium (default)</button>
<button type="button" class="GenshiButton GenshiButton--lg">Large</button>
<button type="button" class="GenshiButton GenshiButton--xl">Extra large</button>

Button appearance

Depending on the intentions, a different visual indication of the button may help convey additional meaning.

  • Use the accent button to boldly indicate the suggested action. Do not abuse of this button, though, because if every action is important, then there is no important action.
  • Use the destructive button to indicate that triggering an action may have consequences where data is removed or affect the system.
  • Use the link button to disguise a button as a link, or to treat it as a ghost button.
<button type="button" class="GenshiButton">Outline</button>
<button type="button" class="GenshiButton GenshiButton--accent">Accent</button>
<button type="button" class="GenshiButton GenshiButton--destructive">Destructive</button>
<button type="button" class="GenshiButton GenshiButton--link">Link</button>

Buttons with icons

The button component is compatible with symbolic icons, such as the ones provided by libraries like Feather, Lucide and similar, as long as these are added semantically.

To add an icon to the button simply add the node before or after the text. You can also omit the text, but please make sure to add an aria-label attribute at the <button> for accessibility purposes. (I shouldn’t be the one telling you here…)

Disabled buttons

Simply add the disabled attribute to the button tag to mark it as disabled.

<button type="button" disabled class="GenshiButton">Can't touch this</button>