1.0.2 • Published 6 months ago
@teinno/react-ui-hero v1.0.2
React UI Hero Component
A flexible and customizable Hero component for React applications.
Installation
npm install @your-org/react-ui-hero
Usage
import { Hero } from '@your-org/react-ui-hero';
function App() {
return (
<Hero
title="Welcome to Our Platform"
subtitle="Discover amazing features and start building today"
primaryAction={{
label: 'Get Started',
onClick: () => console.log('Get Started clicked')
}}
secondaryAction={{
label: 'Learn More',
onClick: () => console.log('Learn More clicked')
}}
/>
);
}
Props
title
(string, required): Main title textsubtitle
(string, optional): Subtitle textchildren
(ReactNode, optional): Additional contentprimaryAction
(object, optional): Primary call-to-action button configurationlabel
(string): Button textonClick
(function): Click handler
secondaryAction
(object, optional): Secondary call-to-action button configurationlabel
(string): Button textonClick
(function): Click handler
backgroundClass
(string, optional): Custom background CSS classes (default: 'bg-gradient-to-r from-blue-600 to-blue-500')imageUrl
(string, optional): Background image URL
Development
Setup
- Clone the repository
- Install dependencies:
npm install
Building
npm run build
Publishing
- Update version in package.json
- Build the package:
npm run build
- Login to npm:
npm login
- Publish the package:
npm publish --access public
License
MIT