@swapneshio/stickyheader
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

@swapneshio/stickyheader

A simple and reusable React component that renders its children within a sticky header with predefined CSS and JavaScript.

Installation

You can install the package using npm, yarn, or pnpm:

npm install @swapneshio/stickyheader

yarn add @swapneshio/stickyheader

pnpm add @swapneshio/stickyheader

CDN Usage

You can include the @swapneshio/stickyheader package directly from jsDelivr using the following link:

https://cdn.jsdelivr.net/npm/@swapneshio/stickyheader@latest/dist/index.js

OR

<script src="https://cdn.jsdelivr.net/npm/@swapneshio/stickyheader@latest/dist/index.js"></script>

Usage

Wrap your header or navigation component within the StickyHeader component to make it sticky.

import React from 'react';
import StickyHeader from '@swapneshio/stickyheader';
import HeaderComponent from './HeaderComponent'; // Import your header component

const App = () => {
  const styles = {
    // Your custom styles here
  };

  return (
    <StickyHeader>
      <HeaderComponent style={styles} className="classnames">
        {/* Your header content */}
      </HeaderComponent>
    </StickyHeader>
  );
};

export default App;

License

This project is licensed under the MIT License - see the LICENSE file for details.

Package Sidebar

Install

npm i @swapneshio/stickyheader

Weekly Downloads

342

Version

2.0.2

License

MIT

Unpacked Size

11.6 kB

Total Files

15

Last publish

Collaborators

  • swapnesh-panda