Back to Components
|

LoadingButton

LoadingButton

A button component with built-in loading states and animations, perfect for forms and async operations

🔧

Live preview would be rendered here

Component: LoadingButton

Install component

npm
$npm install bigblocks
import { LoadingButton } from 'bigblocks';
import { useState } from 'react';

export default function BasicExample() {
  const [loading, setLoading] = useState(false);

  const handleClick = async () => {
    setLoading(true);
    try {
      await someAsyncOperation();
    } finally {
      setLoading(false);
    }
  };

  return (
    <LoadingButton loading={loading} onClick={handleClick}>
      Submit
    </LoadingButton>
  );
}