own-animation
v1.0.5
Published
Reusable Framer Motion animated CTA button for React.
Maintainers
Readme
own-animation
Reusable animated CTA button for React + Framer Motion.
Install
npm install own-animation framer-motionnpx Usage
npx own-animation initThis creates ParthDevButton.jsx in your current folder.
Custom output file:
npx own-animation init --out ParthDevButton.jsxOverwrite existing file:
npx own-animation init --out ParthDevButton.jsx --forceUsage
import { PrimaryHeroButton } from 'own-animation'
export default function App() {
return (
<PrimaryHeroButton
label="Start Free Trial"
onClick={() => console.log('clicked')}
/>
)
}Props
label(string) - Button text.className(string) - Extra classes for custom styling.animation(boolean) - Enable/disable hover animation. Default:true....buttonProps- Any native button props (onClick,disabled,aria-*, etc).
Notes
- The component uses
motion.button, so it requires React and Framer Motion. - The default classes are Tailwind utility classes; override with your own
classNameif needed.
Publish to npm
Update package name in
package.jsonto your unique npm package name.Login:
npm loginBuild and publish:
npm publish --access public
