0.1.1 • Published 8 months ago

@jonali1/react-components v0.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

@jonali1/react-components

A collection of React components built with Next.js.

Installation

npm install @jonali1/react-components
# or
yarn add @jonali1/react-components

Usage

With Default Styles

// Import the component
import { Button } from '@jonali1/react-components';
// Import the styles
import '@jonali1/react-components/styles.css';

function App() {
  return (
    <Button 
      label="Click me" 
      onClick={() => console.log('Button clicked!')} 
    />
  );
}

With Tailwind CSS

If your application already uses Tailwind CSS, you can use the variant="tailwind" prop to use Tailwind classes instead of the default styles:

// Import the component
import { Button } from '@jonali1/react-components';
// No need to import styles.css when using Tailwind variant

function App() {
  return (
    <Button 
      label="Click me" 
      onClick={() => console.log('Button clicked!')} 
      variant="tailwind"
    />
  );
}

Components

Button

A customizable button component.

Props

  • label (string): The text to display on the button
  • onClick (function, optional): Callback function when button is clicked
  • className (string, optional): Additional CSS classes to apply to the button
  • variant (string, optional): Style variant to use. Options: 'default' (uses included CSS) or 'tailwind' (uses Tailwind classes)

Development

# Install dependencies
npm install

# Run development server
npm run next:dev

# Build the library
npm run build

License

MIT

0.1.1

8 months ago

0.1.0

8 months ago