Skip to content

Button

Buttons in five fills and seven intents, four sizes, icon and pill shapes, and groups that fuse into one control.

  • .aparte-btn
On this page
Open

.aparte-btn on a <button> gives it the look of the chat’s own buttons: the send button, the copy button, the approval options. Two axes make every button. An intent says what the colour means (primary, neutral, success, warning, danger, info, secondary); a fill says how loudly (solid, soft, outline, surface, or none, which is the quiet ghost a chat uses most). Any intent works with any fill.

.aparte-btn-group fuses neighbouring buttons into one control, the way the ‹ 1/2 › picker and the site’s own Preview/Code switch are drawn.

Open
Open

--icon makes a square button for a lone glyph, --circle a round one, --pill rounds the ends, --block takes the full width.

VariableDefault
--aparte-btn-size-sm24px
--aparte-btn-size-md32px
--aparte-btn-size-lg36px
--aparte-btn-size-xl40px
--aparte-btn-gapvar(--aparte-space-2)
--aparte-btn-paddingvar(--aparte-space-2) var(--aparte-space-3)
--aparte-btn-radiusvar(--aparte-radius-md)
--aparte-btn-font-sizevar(--aparte-font-size-md)
--aparte-btn-bg-hovervar(--aparte-surface-2)
--aparte-btn-bg-activevar(--aparte-surface-3)
--aparte-btn-bg-toggledvar(--aparte-surface-2)
--aparte-btn-color-toggledvar(--aparte-text)
--aparte-btn-sizevar(--aparte-btn-size-md)
--aparte-btn-inkvar(--aparte-on-intent)
--aparte-btn-icon-sizevar(--aparte-icon-size-lg)
--aparte-btn-padding-smvar(--aparte-space-1) var(--aparte-space-2)
--aparte-btn-padding-lgvar(--aparte-space-3) var(--aparte-space-5)
--aparte-btn-intent—
--aparte-btn-intent-ink—
--aparte-btn-on-intent—

A component inside a container sets the token rather than out-specifying the recipe: the composer’s row declares --aparte-btn-size and every button in it follows.

.aparte-btn · .aparte-btn--block · .aparte-btn--circle · .aparte-btn--danger · .aparte-btn--ghost · .aparte-btn--icon · .aparte-btn--info · .aparte-btn--lg · .aparte-btn--neutral · .aparte-btn--outline · .aparte-btn--pill · .aparte-btn--primary · .aparte-btn--secondary · .aparte-btn--sm · .aparte-btn--soft · .aparte-btn--solid · .aparte-btn--success · .aparte-btn--surface · .aparte-btn--warning · .aparte-btn--xl · .aparte-btn-group · .aparte-btn__icon · .aparte-icon

  • Use a real <button> (or an <a> for a link): the classes give the look, the element gives the keyboard and the role.
  • An icon-only button needs an aria-label; the glyph inside is hidden from screen readers.
  • A group of buttons that acts as one control takes role="group" and a label.
  • Icon — the glyphs buttons carry.
  • Field — the other control recipe.