Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/groovy/llms.txt
Use this file to discover all available pages before exploring further.
DaisyForm reimagines the humble contact form as a blooming daisy. Three input petals radiate from a central yellow submit button: the name petal (fuchsia, rotated −60°), email petal (sky blue, rotated 0°), and message petal (lime green, rotated +60°). Submitting the form triggers a two-phase animation — a Sending Vibes… loading state followed by a confetti burst and a Peace! success confirmation — before automatically resetting after five seconds.
Configuration
DaisyForm accepts no props. Form submission behaviour (endpoint, validation, error handling) is configured directly inside the component. The default implementation uses a 1.5-second artificial delay to simulate a network request; replace the setTimeout with your actual submission logic (e.g. a fetch to an API route or a form service like Formspree).
Petal Fields
| Petal | Field | Input type | Accent colour | Rotation |
|---|---|---|---|---|
| Name | name | text | #d946ef (fuchsia) | −60° |
email | email | #38bdf8 (sky blue) | 0° | |
| Message | message | textarea | #a3e635 (lime) | +60° |
motion.div positioned absolutely around the centre point. The petal’s border and label colour are driven by its accent hex value, making each field visually distinct without relying on placeholder text alone.
Interaction & Animation States
Component state is managed with twouseState variables:
| Variable | Type | Purpose |
|---|---|---|
isSubmitting | boolean | true during the 1.5s send delay; shows ‘Sending Vibes…’ on the button |
isSuccess | boolean | true after the delay resolves; triggers confetti and ‘Peace!’ display |
Submission Flow
- User clicks the centre submit button.
isSubmitting→true. Button label changes to Sending Vibes… and is disabled.- After 1.5 s,
isSubmitting→false,isSuccess→true. - Peace! replaces the button label. Thirty confetti circles burst outward in 6 colours with
repeat: Infinityanimations. - After 5 s,
isSuccess→falseand the form resets to its idle state.
Confetti
The confetti burst spawns 30motion.div circles. Each circle is assigned one of six colours and an independently randomised trajectory (x, y, rotate final values). The animation runs with repeat: Infinity for the duration of the success state, creating a continuous celebratory loop rather than a single-shot burst.
Because the confetti animation uses
repeat: Infinity, it must be interrupted cleanly when isSuccess resets to false. The confetti elements are conditionally rendered only while isSuccess is true, so unmounting them via AnimatePresence with a short exit opacity fade is sufficient to avoid animation memory leaks.