Pico styles native <button> elements—primary by default, with optional secondary, contrast, and outline classes for visual hierarchy (not available in the classless build).
Semantics and grouping
- Use
type="submit"for the main form action;type="button"for in-page actions that do not submit. - Cluster related actions with
fieldset role="group"so cancel/save sit on one row. aria-busy="true"on a button shows Pico’s loading state during async work.- Avoid clickable
divs—role="button"is styled, but realbuttonelements get focus and disabled behavior for free.
Form buttons are full width by default to align with inputs; outside forms, inline button rows behave like normal inline content.
Self-check
- Which classes create a secondary outlined button?
- How do you indicate a submit is in progress without a custom spinner?
- Why keep one obvious primary submit per form?