# P button 41

> Button using the built-in loading prop

A shadcn/ui block from the [@coss](https://coss.com/ui) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/coss/p-button-41).

- Page, with a live preview: https://shadcn.exchange/r/coss/p-button-41
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/coss/p-button-41-light-ae1874ed73b5b9ca.png
- Registry item: https://coss.com/ui/r/p-button-41.json
- Categories: button, loading
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://coss.com/ui/r/p-button-41.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@coss/button`

## Files

### `registry/default/particles/p-button-41.tsx`

```tsx
"use client";

import { useState } from "react";
import { Button } from "@/registry/default/ui/button";

export default function Particle() {
  const [isLoading, setIsLoading] = useState(false);

  const handleClick = () => {
    setIsLoading(true);

    window.setTimeout(() => {
      setIsLoading(false);
    }, 1000);
  };

  return (
    <Button loading={isLoading} onClick={handleClick}>
      Submit
    </Button>
  );
}
```
