1.1.0 • Published 2 years ago

react-metro-tabs v1.1.0

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

React Metro Tabs

windows phone style tabs in react.js

Install

npm install react-metro-tabs
yarn add react-metro-tabs

Demo

npm.io

Github Pages

Github Pages

CodeSandbox

Sandbox

Example Usage

import React, { Component } from "react";

import { MetroTabs, MetroTab } from "react-metro-tabs";

export default function App() {
  return (
    <div
      style={{
        border: "2px solid black",
        borderRadius: 10,
        height: 500,
        width: 300,
      }}
    >
      <MetroTabs onTabChange={(e) => console.log(e)} tabSpaces={50}>
        <MetroTab title='landing page'>content1</MetroTab>
        <MetroTab title='study cases'>content2</MetroTab>
        <MetroTab title='contact us'>content3</MetroTab>
      </MetroTabs>
    </div>
  );
}

MetroTabs props

PropTypeDescriptionDefault
transitionDurationnumbertransition duration1000
tabSpacesnumberspace between tabs, make it dynamic for making responsive70
tabsColorstringcolor of all tabs"#000"
tabFontSizenumberfont size of all tabs"2.5em"
tabFontWeightnumberfont weight of all tabs"normal"
transitionTimingFunctionstringtransition timing function"ease"
onTabChangeFunctionfunction that triggers on tab change
childrenNodechildren (only MetroTab is allowed)

MetroTab props

PropTypeDescriptionDefault
titlestringtitle of the tab
childrenNodechildren (every children are allowed)

License

The source code is licensed under MIT, all assets are copyrighted to their respective owner.

This package uses react-hammerjs underhood.

1.1.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago