button Component

Button Class API Reference

Type Class Options Usage Notes
Base button Required base class Always required (except for close)
close Close button modifier Used with button class: button close
Style Variants outline Border only, no fill Modifier to button
ghost Transparent background Modifier to button
soft Subtle background Modifier to button
labeled With text label Changes to <div> element
Size tiny Extra small size Optional modifier
small Small size Optional modifier
(default) Medium size No class needed
large Large size Optional modifier
big Extra large size Optional modifier
Color (Semantic) primary Main action color Preferred for main actions
positive Success/confirm Green-based
negative Danger/delete Red-based
warning Caution/alert Yellow/orange-based
info Information Blue-based
Color (Extended) red, orange, yellow Warm colors Direct color names
olive, green, teal Green spectrum Direct color names
blue, violet, purple, pink, brown, grey, black Cool & neutral colors Direct color names
State Modifiers active Active/pressed state Visual state
disabled Disabled state Prevents interaction
loading Loading spinner Shows loading state
fluid Full width Takes container width
Icon icon [name] Icon button Replace [name] with icon name
notification Notification badge Special icon variant

Combination Examples

button large primary - Large primary button
button outline small negative - Small negative outline button
button ghost icon save - Ghost save icon button
button soft warning loading - Soft warning button with loading state
button icon settings tiny round - Tiny round settings icon

Modern Button System

Basic Buttons

Preview Code
Copy

Ghost Buttons

Preview Code
Copy

Button Sizes

Size Variations

Preview Code
Copy

Fluid Buttons

Fluid Width Buttons

Preview Code
Copy

Fluid Button Groups

Preview Code
Copy

Button Colors

Default & Brand Colors

Preview Code
Copy

Semantic Colors

Preview Code
Copy

Extended Color Palette

Preview Code
Copy

Outline Button Variants

Preview Code
Copy

Soft Button Variants

Preview Code
Copy

Icon Buttons

Square Icon Buttons

Preview Code
Copy

Round Icon Buttons

Preview Code
Copy

Round Text Buttons

Preview Code
Copy
Single Character
Numbers
Initials / Avatar Style
Short Labels
Emoji Buttons
Color Variations

Button States

Loading States

Preview Code
Copy

Disabled States

Preview Code
Copy

Button Groups

Default Button Group

Preview Code
Copy

Container-Level Sizing

Preview Code
Copy

Container-Level Colors

Preview Code
Copy

Button Groups with OR Divider

Preview Code
Copy

OR Divider with Different Colors

Preview Code
Copy

Icon Button Groups

Preview Code
Copy

Labeled Buttons

Basic Labeled Buttons

Preview Code
Copy
2,048
1.2K
523

Left Labeled Buttons

Preview Code
Copy
15.2MB
3 items

Labeled Icon Buttons

Default Labeled Icon Buttons

Preview Code
Copy
Download
Save File
Delete
Settings

Labeled Icon Button Sizes

Preview Code
Copy
Tiny
Small
Default
Large
Big

Left Icon Position

Preview Code
Copy
Previous
Go Back
Cancel

Basic Variants

Preview Code
Copy
Basic Primary
Basic Positive
Basic Negative

Notification Buttons

Notification Badge Buttons

Preview Code
Copy

Close Buttons

Close buttons provide a unified way to dismiss any element marked with the .dismissible class. They automatically find and close their nearest dismissible parent.

Basic Close Buttons

Preview Code
Copy

Success! Your changes have been saved.

The close button automatically finds its nearest parent with the .dismissible class and closes it. The button can be placed anywhere inside the dismissible container - it doesn't need to be a direct child.

Close Button Sizes

Preview Code
Copy

Note: Each button is wrapped in its own .dismissible container to display styles. Clicking them will trigger the dismiss animation but won't remove them from the page.

Close Button Colors

Preview Code
Copy

Note: Each button is wrapped in its own .dismissible container to display styles. Clicking them will trigger the dismiss animation but won't remove them from the page.

Alternative Ways to Create Close Buttons

Preview Code
Copy

Using class="button close" (standard way)

Using name="close" attribute (alternative)

Using both class and name attributes

How It Works

  • • Add .dismissible to any container you want to be closeable
  • • Add a button with either .button.close classes OR name="close" attribute
  • • The close button automatically finds and closes its nearest dismissible parent
  • • Works at any nesting depth - the button doesn't need to be a direct child
  • • ESC key closes the topmost dismissible element
  • • Supports all standard button sizes and colors when using .button.close classes

Button Overflow System

Button groups can handle overflow situations using two distinct patterns: click-to-expand for limited space and horizontal scrolling for maximum content visibility.

Click-to-Expand Pattern

Preview Code
Copy

Fixed Count (Show first 3 buttons)

Width-based (300px container)

Small buttons with overflow

Horizontal Scroll Pattern

Preview Code
Copy

Horizontal scrolling (400px container)

Try scrolling horizontally, using mouse wheel, or hovering near the edges

Separated scrolling buttons

Icon buttons with scrolling

Mixed Sizes and Colors

Preview Code
Copy

Tiny buttons with overflow

Large buttons with scrolling

Different color schemes

Form Action Overflow

Preview Code
Copy

Modal action buttons

This represents a modal footer with multiple actions that might overflow on smaller screens.

Toolbar actions with scrolling

Button Overflow Usage Guide

Click-to-Expand Pattern
  • class="buttons overflow"
  • data-max-visible="3" - Show first 3 buttons
  • data-max-width="300" - Fit within 300px
  • • Automatically creates "+X more" button
  • • Clicking expands to show all buttons
  • • Perfect for forms and action menus
Horizontal Scroll Pattern
  • class="buttons overflow scroll"
  • data-max-width="400" - Container width
  • • Mouse wheel scrolling supported
  • • Hover zones for auto-scroll
  • • Fade indicators at edges
  • • Perfect for navigation and toolbars

Pro Tip: Both patterns inherit size and color from the container class. Use buttons small overflow primary to make all buttons small and primary colored.