Buttons

A standard button

This is a standard button that can be used on any element. You can add any colour you want to a button by appending it after the btn-color-*

Buttons are generated as needed, new colours do not need to be defined in advance

An anchor button

Icons inside buttons

Icons can be added with font awesome. You just add the icon to the button with out a span or spacing. For every sub element of button it will automatically adding internal gap.

You can add multiple icons on either side of the button text.

Icons inside normal and small buttons

Icons can be big or small, currently you will need to change the size of the icon when inside a smaller button.

TODO Make icons automatically scale to the size of the button they are in.

Multiple icons in button

Dealing with multiple buttons

When dealing with multiple buttons you will want to wrap them inside a flex container and give them some gap

You can also adjust the alignment of the buttons with justify-* on the parent

  • justify-start
  • justify-center
  • justify-between
  • justify-end

Multiple Buttons

Justify-center

Justify-end

Justify-between

Justify-around

Equal width buttons

If you have some collections of buttons that you want them all to be same width you can use an inline grid tricks.

Inline grid by default will only take up as much space as its largest child.

For vertical buttons we force it to use a single column layout with grid-cols-1

For horizontal we use grid-flow-col and auto-cols-fr to create and over flow columns. This results in all the buttons lining up horizontally and being equal widths.

Vertical equal width buttons

Equal width buttons

Outline buttons

Outline buttons are generated in the uno.config.js.

What ever colour you set in the foreground of the button it then renders as the border, and then applies it as transparent background.

Group of outline buttons

Like all other buttons you can add icons and treat them like a standard button.

Outline examples