Reset Button
ResetButton is a reusable button component for Shaddy Form that resets form data.
⚠️ This content is not available in your language yet.
ResetButton
is a reusable button component designed for use within a Shaddy Form. It accepts all generic button props, a custom label, and integrates with react-hook-form
to reset the form state. Use this button inside a Shaddy Form to clear all form fields.
Installation
pnpm dlx shadcn@latest add https://shaddy-docs.vercel.app/r/reset-button
Props
Name | Type | Default | Description |
---|---|---|---|
label | string | "Reset" | The text displayed on the button. |
disabled | boolean | false | Disables the button when set to true. |
className | string | Additional CSS classes for the button. | |
onClick | (e: React.MouseEvent) => void | Optional click handler (called after reset). | |
...Button props | All props from your Button component | Inherits all other props from your Button. |
Usage
import { ShaddyForm, TextField, ResetButton } from "@/components";
function MyForm() {
return (
<ShaddyForm>
<div className="space-y-4">
<TextField
name="email"
label="Email"
required
placeholder="Enter your email"
/>
<ResetButton label="Reset" />
</div>
</ShaddyForm>
);
}