
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-router-drilldown
Advanced tools
provides drilldown-style horizontal slide transitions between index and child routes
This is a simple component that provides drilldown-style horizontal slide transitions between index and child routes.
It is based upon the <Switch> component from react-router v4 and uses react-view-slider internally.
For react-router v2 or v3, see the legacy project.
npm install --save react-router react-router-dom react-router-drilldown
Create a <Drilldown> element with child <Route>s exactly like you would for a <Switch>.
By default the first child <Route> is at the left, and subsequent child routes will slide in from the right.
However, you also customize the order by giving an integer key to each child route.
import React from 'react'
import { render } from 'react-dom'
import { BrowserRouter as Router, Route, Link } from 'react-router-dom'
import Drilldown from 'react-router-drilldown'
const Home = () => (
<div>
<h1>Home</h1>
<p>
<Link to="/users">Users</Link>
</p>
<p>
<Link to="/users/andy">Andy</Link>
</p>
</div>
)
const Users = ({ match }) => (
<div>
<h1>Users</h1>
<Link to={`${match.url}/andy`}>Andy</Link>
</div>
)
const Andy = () => <h1>Andy</h1>
render(
<Router>
<Drilldown>
<Route exact path="/" component={Home} />
<Route exact path="/users" component={Users} />
<Route path="/users/andy" component={Andy} />
</Drilldown>
</Router>,
document.getElementById('root')
)
Note: if you transition directly from / to /users/andy before ever visiting /users, the /users view will not
show in the middle of the animated transition. However, once you have visited /users, it will show between the other
two views when transitioning between them.
Instead of the flat route configuration shown above, you also use a separate drilldown at each level:
const UsersRoute = ({ match }) => (
<Drilldown>
<Route exact path={match.path} component={Users} />
<Route path={`${match.url}/andy`} component={Andy} />
</Drilldown>
)
render(
<Router>
<Drilldown>
<Route exact path="/" component={Home} />
<Route path="/users" component={UsersRoute} />
</Drilldown>
</Router>,
document.getElementById('root')
)
Unlike the flat example above, you will not see the /users view fly by in the middle when transitioning directly
from / to /users/andy.
animateHeight: boolean (default: true)If truthy, will animate its height to match the height of the page at activePage.
keepViewsMounted: boolean (default: false)If truthy, will keep all routes that have rendered before mounted.
keepPrecedingViewsMounted: boolean (default: false)If truthy, will keep routes preceding the active route mounted (but not routes following the active route).
The order is determined by the integer key properties on your <Route>s.
transitionDuration: number (default: 500)The duration of the transition between pages.
transitionTimingFunction: string (default: 'ease')The timing function for the transition between pages.
prefixer: PrefixerIf given, overrides the inline-style-prefixer used to autoprefix inline styles.
fillParent: boolean (default: false)If truthy, Drilldown will use absolute positioning on itself and its pages to fill its parent element.
className: stringAny extra class names to add to the root element.
style: ObjectExtra inline styles to add to the root element.
viewportClassName: stringAny extra class names to add to the inner "viewport" element.
viewportStyle: ObjectExtra inline styles to add to the inner "viewport" element.
viewStyle: ObjectExtra inline styles to add to the view wrapper elements.
innerViewWrapperStyle: ObjectExtra inline styles to add to the inner div between the viewStyle div and your
view content element. (The inner div was added to ensure perfect height
animation.)
location: Location (default: accessed from withRouter)If given, this location is used instead of the one from withRouter.
FAQs
provides drilldown-style horizontal slide transitions between index and child routes
The npm package react-router-drilldown receives a total of 139 weekly downloads. As such, react-router-drilldown popularity was classified as not popular.
We found that react-router-drilldown 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.