Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
An App Bar for React that stays out of your way.
When the scrolling is just right
Also known as a Header, a Navigation Bar, or a Navbar. I chose App Bar because it was available on npm.
Basic usage:
import React from 'react';
import { css } from 'emotion';
import Navigation from 'app-bar';
import { HamburgerMenu, Logo } from './components';
...
const styles = css`
background-color: white;
box-shadow: ${open ? 'none' : '0 1px 2px rgba(0, 0, 0, 0.08)'};
height: 64px;
`;
...
<Navigation className={styles} disabled={open}>
<Logo />
<HamburgerMenu open={open} />
</Navigation>
The app-bar
comes with very little defaults, and should be styled by supplying it with a className
property that is attached some CSS.
The <AppBar />
component is <div />
element with the following inline styles:
display: block;
position: sticky;
top: 0;
width: 100%;
In other words, <AppBar />
is a fixed full-width element that sticks to the top of your screen. The only functionality is that <AppBar />
will move out the viewport when scrolling down, and back in when scrolling up.
If you want to disable <AppBar />
's behaviour, supply the disabled
prop. When disabled, <AppBar />
will simply stick to the top of the screen.
If you need to access the dom element, you can supply a function via the innerRef
prop.
FAQs
An app bar for React that stays out of your way
We found that app-bar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.