1.0.1 • Published 2 years ago

panel-navigation v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

npm NPM Codecov branch

🎉 Features

  • Written in Typescript, Friendly Static Type Support.

🔥 Demo

Live demo: panel-navigation

🔥 Install

# with npm
npm install panel-navigation

👍 Usage

Here is a quick example to get you started, it's all you need:

import React, { useState } from "react";
import { createRoot } from 'react-dom/client';
import { Navigation, Item, Panel } from 'panel-navigation';
import 'panel-navigation/lib/index.css';

const App = () => {
  return (
    <Navigation>
      <Panel itemKey="0" content={<About />}>
        <span>About Us</span>
      </Panel>
      <Panel itemKey="1" content={<Services />}>
        <span>Services</span>
      </Panel>
      <Item isSubPage={true}>
        <a>Studies</a>
      </Item>
      <Item>
        <a>News</a>
      </Item>
    </Navigation>
});

createRoot(document.getElementById('root')).render(<App />);

How to import

import { Navigation, Item, Panel } from 'panel-navigation';
import 'panel-navigation/lib/index.css';

Eases

Component uses a default ease of "expo.out". You can easily overwrite this by setting the ease property to another (valid) ease value.

  • none.none
  • power1.out
  • circ.out
  • power4.out

API Reference

PropertiesDescriptionTypeDefault
visiblecontrol visible statebooleantrue
easeease propertystringexpo.out
durationthe duration of the transition, in millisecondsnumber600
onEnteredcallback fired after the "entered" status is applied.function(e) => {}() => {}
onExitedcallback fired after the "exited" status is applied.function(e) => {}() => {}
htmlClassNameadd className to html tagstringscrollDisabled

Panel

PropertiesDescriptionTypeDefault
itemKeykey of the panelstring
isSubPageset a special stylebooleanfalse
contentpanel contentReactNode

Item

PropertiesDescriptionTypeDefault
isSubPageset some special stylebooleanfalse

🎈 License

React Navigation is MIT Licensed