npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@misnpm/design-banners

v1.0.39

Published

``` # Design Banners: Customizable React UI Components for Banners

Readme

    # Design Banners: Customizable React UI Components for Banners

Design Banners is a flexible React library that provides customizable UI components for creating visually appealing banners. It offers a centralized design management system with multiple pre-built UI layouts, making it easy to integrate and customize banners in your React applications.

## Repository Structure

The repository is organized as follows:

- `src/`: Contains the source code for the components and utilities.
  - `components/`: Houses the main components and individual UI designs.
  - `utils/`: Includes utility functions and default props.
- `dist/`: Contains the compiled and bundled output files.
- `rollup.config.js`: Configuration file for Rollup, the bundler used in this project.
- `tsconfig.json`: TypeScript configuration file.
- `.storybook/`: Storybook configuration for component development and testing.

Key files:
- `src/index.tsx`: Main entry point for the library.
- `src/components/DesignManager.tsx`: Central component for managing different UI designs.
- `package.json`: Project metadata and dependencies.

## Usage Instructions

### Installation

To install Design Banners in your project, run:

```bash
npm install @misnpm/design-banners

Ensure you have React 16.8+ installed in your project.

Getting Started

Import the DesignManager component in your React application:

import { DesignManager } from '@misnpm/design-banners';

Use the DesignManager component in your JSX, specifying the desired UI and props:

<DesignManager 
  selectUI="UI1" 
  propsUI={{
    title: "Welcome",
    subtitle: "To Our Website",
    description: "Explore our amazing features",
    buttonText: "Get Started",
    backgroundImage: "path/to/your/image.jpg"
  }}
/>

Configuration Options

The DesignManager component accepts two main props:

  • selectUI: Specifies which UI design to use (e.g., "UI", "UI1", "UI2", "UI3").
  • propsUI: An object containing the props for the selected UI design.

Each UI design has its own set of configurable props, including:

  • title: Main title text
  • subtitle: Subtitle text
  • description: Descriptive text
  • backgroundImage: URL for the background image
  • buttonText: Text for the call-to-action button
  • buttonColor: Background color of the button
  • buttonTextColor: Text color of the button
  • buttonAction: Function to be called when the button is clicked

Refer to the individual UI component files for a complete list of available props.

Common Use Cases

  1. Simple Banner:
<DesignManager 
  selectUI="UI" 
  propsUI={{
    backgroundImage: "path/to/banner-image.jpg"
  }}
/>
  1. Banner with Text and Button:
<DesignManager 
  selectUI="UI1" 
  propsUI={{
    title: "Summer Sale",
    description: "Get 50% off on all items",
    buttonText: "Shop Now",
    backgroundImage: "path/to/sale-image.jpg",
    buttonAction: () => console.log("Button clicked")
  }}
/>
  1. Complex Banner with Multiple Elements:
<DesignManager 
  selectUI="UI3" 
  propsUI={{
    logo: "path/to/logo.png",
    title: "New Product Launch",
    subtitle: "Introducing",
    description: "Experience the future of technology",
    buttonText: "Learn More",
    backgroundImage: "path/to/product-bg.jpg",
    secondImage: "path/to/product-image.png"
  }}
/>

Testing & Quality

To run tests for the Design Banners library, use the following command:

npm test

This will execute the test suite and provide feedback on the components' functionality.

Troubleshooting

  1. Issue: Background image not displaying

    • Ensure the image URL is correct and accessible.
    • Check if the image format is supported by the browser.
    • Verify that the backgroundImage prop is correctly passed to the component.
  2. Issue: Button action not working

    • Confirm that the buttonAction prop is a valid function.
    • Check the browser console for any JavaScript errors.
  3. Issue: Responsive design issues

    • Ensure that the viewport meta tag is set correctly in your HTML:
      <meta name="viewport" content="width=device-width, initial-scale=1" />
    • Verify that you're using the latest version of the library.

For more detailed debugging:

  • Enable React Developer Tools in your browser to inspect component props and state.
  • Use browser developer tools to check for any CSS conflicts or layout issues.

Data Flow

The Design Banners library follows a simple data flow:

  1. The user selects a UI design and provides props through the DesignManager component.
  2. DesignManager determines the appropriate UI component based on the selectUI prop.
  3. The selected UI component receives the props and renders the banner accordingly.
  4. User interactions (e.g., button clicks) trigger the corresponding actions defined in the props.
[User Input] -> [DesignManager] -> [Selected UI Component] -> [Rendered Banner]
     ^                                       |
     |                                       |
     +---------------------------------------+
              (User Interaction)

Note: The DesignManager acts as a central hub, allowing for easy switching between different banner designs without changing the parent component's implementation. ```