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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-omniroom-alpha

v0.2.6

Published

React Omniroom is a lightweight, customizable React component that provides a dynamic navigation bar for web applications. It enhances user experience by maximizing screen real estate.

Downloads

35

Readme

React OmniRoom

React OmniRoom is a dynamic and user-friendly React component designed to manage the visibility of navigation bars in your web applications. It enhances the user experience by automatically hiding the navigation bar when scrolling and revealing it when scrolling in the opposite direction. This maximizes screen real estate without sacrificing easy navigation access.

Key Features

  • Dynamic Visibility: The navigation bar automatically hides when scrolling down and shows when scrolling up, providing a clean and immersive user experience.

  • Easy to Use: Simply wrap your navigation bar component with react-omniroom and it handles the rest.

  • Customizable: Supports all standard div attributes, allowing you to customize the navigation bar to fit your needs.

  • Lightweight: With a small footprint, it doesn’t add unnecessary weight to your project.

Installation

You can install react-omniroom using npm:

  npm install react-omniroom

Usage

Here’s a basic example of how to use react-omniroom in your application:

import { HeadRoom, FootRoom, PortRoom, StarboardRoom } from 'react-omniroom';



<HeadRoom hideDistance='28' hiddenClassName='hidden'>
  <h1>This will stick on top of ther viewport</h1>
</HeadRoom>


<FootRoom hideDistance='28' hiddenClassName='hidden'>
  <h1>This will stick on bottom of the viewport</h1>
</FootRoom>


<PortRoom hideDistance='28' hiddenClassName='hidden'>
  <h1>This will stick on the left side of the viewport</h1>
</PortRoom>


<StarboardRoom hideDistance='28' hiddenClassName='hidden'>
  <h1>This will stick on the right side of the viewport</h1>
</StarboardRoom>

Threshold

In the context of React OmniRoom, the threshold which default to 100, is a certain scroll distance that the user must exceed before the components start to hide. This means that the components will not hide immediately when the user starts scrolling, but only after they’ve scrolled past this threshold distance.

Tailwind CSS

React OmniRoom is designed to work seamlessly with Tailwind CSS, a utility-first CSS framework. This means you can use Tailwind’s utility classes to easily style and customize your navigation bars.

  • className (optional): You can pass Tailwind utility classes directly to the className prop. This allows you to style the default state of your navigation bars. For example, you can set the background color, text color, padding, margin, etc.

  • hiddenClassName (required with Tailwind CSS): This prop is used to apply styles when the navigation bar is in a hidden state. You must use Tailwind classes for this prop. When the navigation bar is hidden (i.e., when the user scrolls), the classes passed to hiddenClassName will be applied. This allows you to further customize the appearance of the navigation bar during its hidden state. For example, you can change the background color, apply a shadow, change the border style, etc.

By leveraging Tailwind CSS with React OmniRoom, you can create dynamic, responsive, and beautifully styled navigation bars with minimal effort. Remember, the power of Tailwind CSS comes from its utility-first approach, which provides a set of low-level, composable classes that let you build any design, directly in your markup. This makes it a great fit for React OmniRoom’s customizable props. 😊

CSS Integration

React OmniRoom is designed to work seamlessly with CSS. You can add a default CSS class to the className prop, and when any of the room components (HeadRoom, FootRoom, PortRoom, StarboardRoom) are hidden, you can style them accordingly.

To do this, you can use a combination of the word ‘hidden’ and the room name, i.e., hiddenHeadRoom, hiddenFootRoom, hiddenPortRoom, hiddenStarRoom. This allows you to apply specific styles when the room is in a hidden state.

Contributing

We welcome contributions to react-omniroom! If you have a feature request, bug report, or want to improve the library, feel free to open an issue or submit a pull request on our github the React Omniroom GitHub repository.