/react-tabs

Accessible tabs (in React).

Primary LanguageJavaScriptMIT LicenseMIT

react-tabs

GitHub license npm version CircleCI Status Coverage

Accessible tabs (in React).

View in Storybook.

Install

npm i @bscop/react-tabs

Usage

import Tabs from "@bscop/react-tabs";

function App () {
  return (
    <Tabs 
      tabs={[
        {
          id: "tab-1",
          label: "Section one",
          renderContent () {
            return (
              <p>Content of the first tab ...</p>
            );
          },
        },
        {
          id: "tab-2",
          label: "Section two",
          renderContent () {
            return (
              <p>Content of the second tab ...</p>
            );
          },
        }
      ]}
      title="Switch tab"
    />
  );
}

Contribute

Read the guidelines.

Run tests

npm test

Coverage

Coverage reports are hosted on codecov.

npm run badge:coverage -- --token=<guid>

Bruno Scopelliti
www.brunoscopelliti.com