A favicon of ProgressButton

ProgressButton

A React component extending shadcn/ui buttons, using XState to visually show progress for tasks with manual or automatic updates and feedback states.

A screenshot of ProgressButtonVisit

ProgressButton: Stateful Progress Feedback for shadcn/ui Buttons

The ProgressButton component enhances user experience for asynchronous tasks by extending shadcn/ui buttons with visual progress. It leverages XState for robust state management, supporting both manual and automatic progress updates. This React component provides clear feedback for operations like file uploads or form submissions, offering a versatile solution for developers seeking to improve interactivity and user understanding of ongoing processes within their applications.

Features:

  • Manual and Automatic Progress Control: Offers flexibility by allowing progress to be updated either programmatically through props or simulated automatically based on specified timings and steps.
  • XState-Powered State Management: Integrates XState to orchestrate component states and transitions, ensuring a robust and predictable user experience flow.
  • Customizable Visuals and Behavior: Provides options to personalize the button's appearance, such as the success state color using Tailwind CSS, and to configure how progress is displayed (manual or automatic).
  • Clear User Feedback States: Delivers intuitive visual cues to the user by cycling through distinct states including idle, in-progress, successful completion, and error conditions.
  • shadcn/ui Button Extension: Enhances the capabilities of the standard button component from the popular shadcn/ui library, providing additional progress-related functionalities.
  • Defined State Transitions: Operates based on a clear XState state machine that governs transitions between states like idle, inProgress, success, and successFadeOut for consistent behavior.
  • Lifecycle Event Callbacks: Enables developers to respond to key events in the button's lifecycle through onClick, onComplete, and onError callback props.
  • Tailwind CSS Styling Integration: Facilitates easy styling using Tailwind CSS, and includes a mechanism to ensure all Tailwind color classes are available for customizing the button's success appearance.

Summary:

ProgressButton is a React component that adds dynamic progress visualization to shadcn/ui buttons. Managed by XState, it allows developers to display either manually controlled or automatically simulated progress for user actions. With features like customizable success colors, event callbacks, and clear visual states for idle, ongoing, success, or error scenarios, it significantly improves user feedback during asynchronous operations, making it a valuable tool for modern web interfaces.

Distribution:
opensource
GitHub:
91 Stars
3 Forks
Share:

 

  
 

Similar to ProgressButton:

 

  
  

 

  
  

 

  
  
ProgressButton: Shadcn/ui Buttons with Stateful Progress UX, Powered by XState. – Awesome-Shadcn/ui