Buttons

Simple

Primary, secondary, ghost, and icon buttons with hover states and loading animations

Updated about 1 month ago
Tested & Responsive

Live Demo

Button Variants

Primary, secondary, and ghost button styles

Simple
Preview:
Desktop view

Resize to see how the component adapts to different screen sizes

📖 Button Variants Overview

This example demonstrates three essential button variants: primary, secondary, and ghost styles. Each variant serves a different purpose in your interface hierarchy and visual design system.

Complexity: Simple

🎯 Button Hierarchy

  • Primary - Main call-to-action buttons with solid forest background
  • Secondary - Supporting actions with outlined border style
  • Ghost - Subtle actions with transparent background and hover effects
  • • Consistent spacing and typography across all variants
  • • Hover and focus states for enhanced user feedback

💡 Usage Guidelines

  • • Use primary for the most important action on a page
  • • Use secondary for important but not primary actions
  • • Use ghost for subtle or tertiary actions
  • • Maintain visual hierarchy with proper variant selection

Button Sizes

Small, medium, and large button sizes

Simple
Preview:
Desktop view

Resize to see how the component adapts to different screen sizes

📖 Button Sizes Overview

Small, medium, and large button sizes

Complexity: Simple

💡 Key Features

  • • Button Sizes functionality with Stimulus controller
  • • Buttons, modals, dropdowns, and interactive UI components
  • • Responsive design optimized for all screen sizes
  • • Accessible markup with proper semantic HTML
  • • Modern CSS transitions and interactive effects
  • • Enhanced with buttons capabilities
  • • Enhanced with interactive capabilities
  • • Enhanced with click capabilities
  • • Enhanced with primary capabilities
  • • Enhanced with secondary capabilities
  • • Enhanced with ghost capabilities
  • • Enhanced with icon capabilities
  • • Enhanced with loading capabilities

Icon Buttons

Buttons with icons and loading spinners

Simple
Preview:
Desktop view

Resize to see how the component adapts to different screen sizes

📖 Icon Buttons Overview

Buttons with icons and loading spinners

Complexity: Simple

💡 Key Features

  • • Icon Buttons functionality with Stimulus controller
  • • Buttons, modals, dropdowns, and interactive UI components
  • • Responsive design optimized for all screen sizes
  • • Accessible markup with proper semantic HTML
  • • Modern CSS transitions and interactive effects
  • • Enhanced with buttons capabilities
  • • Enhanced with interactive capabilities
  • • Enhanced with click capabilities
  • • Enhanced with primary capabilities
  • • Enhanced with secondary capabilities
  • • Enhanced with ghost capabilities
  • • Enhanced with icon capabilities
  • • Enhanced with loading capabilities

Button States

Loading and disabled button states

Simple
Preview:
Desktop view

Resize to see how the component adapts to different screen sizes

📖 Button States Overview

Loading and disabled button states

Complexity: Simple

💡 Key Features

  • • Button States functionality with Stimulus controller
  • • Buttons, modals, dropdowns, and interactive UI components
  • • Responsive design optimized for all screen sizes
  • • Accessible markup with proper semantic HTML
  • • Modern CSS transitions and interactive effects
  • • Enhanced with buttons capabilities
  • • Enhanced with interactive capabilities
  • • Enhanced with click capabilities
  • • Enhanced with primary capabilities
  • • Enhanced with secondary capabilities
  • • Enhanced with ghost capabilities
  • • Enhanced with icon capabilities
  • • Enhanced with loading capabilities

Button Groups

Connected button groups and toolbars

Medium
Preview:
Desktop view

Resize to see how the component adapts to different screen sizes

📖 Button Groups Overview

Connected button groups and toolbars

Complexity: Simple

💡 Key Features

  • • Button Groups functionality with Stimulus controller
  • • Buttons, modals, dropdowns, and interactive UI components
  • • Responsive design optimized for all screen sizes
  • • Accessible markup with proper semantic HTML
  • • Modern CSS transitions and interactive effects
  • • Enhanced with buttons capabilities
  • • Enhanced with interactive capabilities
  • • Enhanced with click capabilities
  • • Enhanced with primary capabilities
  • • Enhanced with secondary capabilities
  • • Enhanced with ghost capabilities
  • • Enhanced with icon capabilities
  • • Enhanced with loading capabilities

Split Buttons

Split buttons with dropdown menus

Medium
Preview:
Desktop view

Resize to see how the component adapts to different screen sizes

📖 Split Buttons Overview

Split buttons with dropdown menus

Complexity: Simple

💡 Key Features

  • • Split Buttons functionality with Stimulus controller
  • • Buttons, modals, dropdowns, and interactive UI components
  • • Responsive design optimized for all screen sizes
  • • Accessible markup with proper semantic HTML
  • • Modern CSS transitions and interactive effects
  • • Enhanced with buttons capabilities
  • • Enhanced with interactive capabilities
  • • Enhanced with click capabilities
  • • Enhanced with primary capabilities
  • • Enhanced with secondary capabilities
  • • Enhanced with ghost capabilities
  • • Enhanced with icon capabilities
  • • Enhanced with loading capabilities

Installation & Usage

1

Copy the ERB template

Copy the ERB code from the template tab above and paste it into your Rails view file.

2

Add the Stimulus controller

Create the Stimulus controller file in your JavaScript controllers directory.