Coder Social home page Coder Social logo

react-bootstrap-tabs's Introduction

React Tabs component using Bootstrap 4  npm version Build Status

This is a react component to render tabs using Bootstrap 4 classes. You should have Bootstrap 4 installed already in your app.

Demo

All of the features are demonstrated on the demo site so please see the source file:

https://github.com/freeranger/react-bootstrap-tabs-demo/blob/master/app/App.js

for examples of how to use it in your own applications.

Usage

  1. install the package:
npm install react-bootstrap-tabs --save

2. Import component

With ES2015:

import {Tabs, Tab} from 'react-bootstrap-tabs';

3. Add the component markup to your react component

<Tabs onSelect={(index, label) => console.log(label + ' selected')}>
    <Tab label="Tab1">Tab 1 content</Tab>
    <Tab label="Tab2">Tab 2 content</Tab>
</Tabs>

Developing

  1. Clone this repo
  2. Inside cloned repo run npm install
  3. If you want to run tests: npm test or npm run testonly or npm run test-watch. Write tests in the tests folder. You need at least Node 4 on your machine to run tests.
  4. If you want to run linting: npm test or npm run lint. Fix bugs: npm run lint-fix. You can adjust your .eslintrc config file.
  5. If you want to run transpilation to ES5 in dist folder: npm run prepublish (standard npm hook).

License

MIT

react-bootstrap-tabs's People

Contributors

dependabot[bot] avatar freeranger avatar justinchen avatar kunokdev avatar lidaof avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-bootstrap-tabs's Issues

tabs are not showing title/Tab name, what is the issue?

Code:

import React, {Component} from 'react';
import {connect} from 'react-redux';
import {Tab, Tabs, TabList, TabPanel} from 'react-bootstrap-tabs';

const tabsInstance = (

Tab 1 content

Tab 2 content

Tab 3 content
);
class ProfileTab extends Component {
constructor(props){
super(props);

}
render(){
return (

{tabsInstance}

);
}
}

export default ProfileTab;

mis-spelling on install call

Hi there,

you're missing a 't' in 'bootstrap' in your readme install instructions:

npm install react-boostrap-tabs --save

cheers,

Uili

componentWillReceiveProps will eventually be deprecated.

Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.

  • Move data fetching code or side effects to componentDidUpdate.
  • If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
  • Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

Set Default Tab

Is there any way to set default tab? I want the tab 2 to be selected when the component is loaded intially.

onSelect property not working

I am using Tabs with react and redux but onSelect doesn't work.
I am displaying data dynamically from redux store in each tabs.
The tab data changes after double click on Tabs Header.
Is there any solution for this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.