All Projects → maslianok → react-responsive-tabs

maslianok / react-responsive-tabs

Licence: MIT license
React responsive tabs http://maslianok.github.io/react-responsive-tabs/

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to react-responsive-tabs

Responsive Tabs
Responsive Tabs is a jQuery plugin that provides responsive tab functionality. The tabs transform to an accordion when it reaches a CSS breakpoint. You can use this plugin as a solution for displaying tabs elegantly on desktop, tablet and mobile.
Stars: ✭ 529 (+348.31%)
Mutual labels:  responsive, accordion, tabs
esl
Lightweight and flexible UI component library based on web components technology for creating basic UX modules
Stars: ✭ 53 (-55.08%)
Mutual labels:  accordion, tabs
Ng Bootstrap
Angular powered Bootstrap
Stars: ✭ 7,872 (+6571.19%)
Mutual labels:  accordion, tabs
a11y-accordion-tabs
A script for an accessible accordion tabs component
Stars: ✭ 50 (-57.63%)
Mutual labels:  accordion, tabs
Core Components
Accessible and lightweight Javascript components
Stars: ✭ 85 (-27.97%)
Mutual labels:  accordion, tabs
Hibiscus.js
Native Angular directives for Bootstrap4
Stars: ✭ 115 (-2.54%)
Mutual labels:  accordion, tabs
yuanful-ui
(微信小程序插件) yuanful-ui是一套可添加到微信小程序内直接使用的免费功能插件,无需重复开发,为用户提供更丰富的服务。
Stars: ✭ 30 (-74.58%)
Mutual labels:  accordion, tabs
aioneframework
Aione Framework: All-in-one lightweight mobile first front-end framework to design websites, web applications, mobile applications, progressive web applications having large number of examples, documentation, tutorials, community support, components.
Stars: ✭ 13 (-88.98%)
Mutual labels:  responsive, tabs
flutter responsive tabs
Flutter Responsive Tabs Demo
Stars: ✭ 43 (-63.56%)
Mutual labels:  responsive, tabs
figma-responsify
⚡️A Figma plugin to quickly test your designs across multiple device sizes.
Stars: ✭ 51 (-56.78%)
Mutual labels:  responsive
hugo-lamp
A light Hugo AMP responsive theme for blogger ⚡.
Stars: ✭ 51 (-56.78%)
Mutual labels:  responsive
tomloprodModal
tomloprodModal is a configurable pure javascript library to create responsive and minimalist modal windows with no dependencies.
Stars: ✭ 17 (-85.59%)
Mutual labels:  responsive
markdown-fenced-code-tabs
Generates tabs for consecutive markdown code blocks
Stars: ✭ 46 (-61.02%)
Mutual labels:  tabs
smart-webcomponents-community
Material & Bootstrap Web Components built with Smart
Stars: ✭ 30 (-74.58%)
Mutual labels:  tabs
react-super-styled
Responsive JSX layouts with Styled Components
Stars: ✭ 77 (-34.75%)
Mutual labels:  responsive
mdebug
基于React开发的新一代web调试工具,支持React组件调试,类似于Chrome Devtools。A Lightweight, Easy To Extend Web Debugging Tool Build With React
Stars: ✭ 237 (+100.85%)
Mutual labels:  tabs
v-switcher
An powerful display tabs with Vue
Stars: ✭ 56 (-52.54%)
Mutual labels:  tabs
react-notification-alert
React bootstrap 4 notification alert
Stars: ✭ 34 (-71.19%)
Mutual labels:  responsive
svelto
Modular front end framework for modern browsers, with battery included: 100+ widgets and tools.
Stars: ✭ 61 (-48.31%)
Mutual labels:  responsive
guitar
🎸 Online guitar toy and tablature recorder/player
Stars: ✭ 80 (-32.2%)
Mutual labels:  tabs

React responsive tabs

Live demo

Your feedback is highly appreciated!

Please, file an issue if something went wrong or let me know via Twitter @maslianok

Responsive

  • Hide tabs under the 'Show more' option when they don't fit into the screen
  • Transform tabs into the accordion when the wrapper width reaches the transformWidth value

Responsive tabs

Accessible

The component outputs HTML code that follows accessibility principles (aka WAI-ARIA) and uses ARIA attributes such as role, aria-selected, aria-controls, aria-labeledby etc.

Accessible tabs

Fast

We are using react-resize-detector. No timers. Just pure event-based element resize detection.

Installation

npm install react-responsive-tabs

Demo

Live demo

Local demo

# 1. clone the repository
git clone https://github.com/maslianok/react-responsive-tabs.git

# 2. Install react-responsive-tabs dependencies. You must do it because we use raw library code in the example
cd react-responsive-tabs
npm install

# 3. Install dependencies to run the example
cd examples
npm install

# 4. Finally run the example
npm start

Example

import React, { Component } from 'react';
import { render } from 'react-dom';
import Tabs from 'react-responsive-tabs';

// IMPORTANT you need to include the default styles
import 'react-responsive-tabs/styles.css';

const presidents = [
  { name: 'George Washington', biography: '...' },
  { name: 'Theodore Roosevelt', biography: '...' },
];

function getTabs() {
  return presidents.map((president, index) => ({
    title: president.name,
    getContent: () => president.biography,
    /* Optional parameters */
    key: index,
    tabClassName: 'tab',
    panelClassName: 'panel',
  }));
}

const App = () => <Tabs items={getTabs()} />;

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

API

All entities listed below should be used as props to the Tabs component.

Prop Type Description Default
items Array Tabs data Item[]
beforeChange Function Fires right before a tab changes. Return false to prevent the tab change undefined
onChange Function onChange callback undefined
selectedTabKey Number/String Selected tab undefined
showMore Bool Whether to show Show more or not true
showMoreLabel String/Node Show more tab name ...
transform Bool Transform to accordion when the wrapper width is less than transformWidth. true
transformWidth Number Transform width. 800
unmountOnExit Bool Whether to unmount inactive tabs from DOM tree or not true
tabsWrapperClass String Wrapper class undefined
tabClassName String Tab class undefined
panelClassName String Tab panel class undefined
allowRemove Bool Allows tabs removal. false
removeActiveOnly Bool Only active tab has removal option false
showInkBar Bool Add MaterialUI InkBar effect false
uid any An optional external id. The component rerenders when it changes undefined

Item

Prop Type Description
title String Tab title
getContent Function A function that returns data that will be rendered when tab become active
content String Use this prop insted of getContent. This is a sync version of getContent. The data will be always rendered in a hidden div. Sometimes it may be useful for SEO
key Number A uniq tab id
tabClassName String Tab class name
panelClassName String Panel class name

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].