secondsky/claude-skills / plugins/auto-animate/skills/auto-animate
auto-animate
VerifiedAutoAnimate (@formkit/auto-animate) zero-config animations for React. Use for list transitions, accordions, toasts, or encountering SSR errors, animation libraries complexity.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.4 KB |
| assets/example-template.txt | markdown | 416 B |
| references/auto-animate-vs-motion.md | markdown | 9.8 KB |
| references/css-conflicts.md | markdown | 13.0 KB |
| references/example-reference.md | markdown | 760 B |
| references/ssr-patterns.md | markdown | 12.4 KB |
| scripts/example-script.shexecutable | script | 302 B |
| scripts/init-auto-animate.shexecutable | script | 8.8 KB |
| templates/accordion.tsx | other | 2.7 KB |
| templates/filter-sort-list.tsx | other | 3.2 KB |
| templates/form-validation.tsx | other | 4.2 KB |
| templates/react-basic.tsx | other | 2.8 KB |
| templates/react-typescript.tsx | other | 4.7 KB |
| templates/toast-notifications.tsx | other | 1.9 KB |
| templates/vite-ssr-safe.tsx | other | 4.2 KB |
templates/form-validation.tsx
View on GitHub// AutoAnimate - Form Validation Messages
// Error messages that smoothly appear/disappear
import { useAutoAnimate } from "@formkit/auto-animate/react";
import { useState } from "react";
interface FormData {
email: string;
password: string;
confirmPassword: string;
}
interface Errors {
email?: string;
password?: string;
confirmPassword?: string;
}
export function FormValidationExample() {
const [emailParent] = useAutoAnimate();
const [passwordParent] = useAutoAnimate();
const [confirmParent] = useAutoAnimate();
const [formData, setFormData] = useState<FormData>({
email: "",
password: "",
confirmPassword: "",
});
const [errors, setErrors] = useState<Errors>({});
const [touched, setTouched] = useState<Record<string, boolean>>({});
const validate = () => {
const newErrors: Errors = {};
if (!formData.email) {
newErrors.email = "Email is required";
} else if (!/\S+@\S+\.\S+/.test(formData.email)) {
newErrors.email = "Email is invalid";
}
if (!formData.password) {
newErrors.password = "Password is required";
} else if (formData.password.length < 8) {
newErrors.password = "Password must be at least 8 characters";
}
if (formData.password !== formData.confirmPassword) {
newErrors.confirmPassword = "Passwords do not match";
}
setErrors(newErrors);
return Object.keys(newErrors).length === 0;
};
const handleBlur = (field: keyof FormData) => {
setTouched({ ...touched, [field]: true });
validate();
};
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
setTouched({ email: true, password: true, confirmPassword: true });
if (validate()) {
alert("Form submitted successfully!");
}
};
return (
<form onSubmit={handleSubmit} className="max-w-md mx-auto p-6 space-y-4">
{/* Email */}
<div>
<label className="block text-sm font-medium mb-1">Email</label>
<input
type="email"
value={formData.email}
onChange={(e) => setFormData({ ...formData, email: e.target.value })}
onBlur={() => handleBlur("email")}
className={`w-full px-3 py-2 border rounded ${
touched.email && errors.email ? "border-red-500" : ""
}`}
/>
<div ref={emailParent}>
{touched.email && errors.email && (
<p className="text-red-500 text-sm mt-1">{errors.email}</p>
)}
</div>
</div>
{/* Password */}
<div>
<label className="block text-sm font-medium mb-1">Password</label>
<input
type="password"
value={formData.password}
onChange={(e) => setFormData({ ...formData, password: e.target.value })}
onBlur={() => handleBlur("password")}
className={`w-full px-3 py-2 border rounded ${
touched.password && errors.password ? "border-red-500" : ""
}`}
/>
<div ref={passwordParent}>
{touched.password && errors.password && (
<p className="text-red-500 text-sm mt-1">{errors.password}</p>
)}
</div>
</div>
{/* Confirm Password */}
<div>
<label className="block text-sm font-medium mb-1">Confirm Password</label>
<input
type="password"
value={formData.confirmPassword}
onChange={(e) =>
setFormData({ ...formData, confirmPassword: e.target.value })
}
onBlur={() => handleBlur("confirmPassword")}
className={`w-full px-3 py-2 border rounded ${
touched.confirmPassword && errors.confirmPassword
? "border-red-500"
: ""
}`}
/>
<div ref={confirmParent}>
{touched.confirmPassword && errors.confirmPassword && (
<p className="text-red-500 text-sm mt-1">{errors.confirmPassword}</p>
)}
</div>
</div>
<button
type="submit"
className="w-full px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700"
>
Submit
</button>
</form>
);
}
/**
* Pattern: Each error message has its own parent ref
* This allows independent animations for each field
*/
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |