1.2.7 • Published 5 days ago

@igloo-ui/tabs v1.2.7

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 days ago

Tabs

Use to alternate among related views within the same context.

Installation

To install @igloo-ui/tabs in your project, you will need to run the following command using npm:

npm install @igloo-ui/tabs

If you prefer Yarn, use the following command instead:

yarn add @igloo-ui/tabs

Usage

Then to use the component in your code just import it!

import Tabs from '@igloo-ui/tabs';

<Tabs
  tabs={[
    {
      label: 'Premium Tab',
      premium: true,
      children: 'Content of premium tab',
    },
    {
      label: 'Notification Tab',
      notification: true,
      children: 'Content of notification tab',
    },
    {
      label: 'Premium Notification Tab',
      notification: true,
      premium: true,
      children: 'Content of premium notification tab',
    },
  ]}
/>;

Variation

Pass the onClick with the navlink when using react router

<BrowserRouter>
  <Tabs
    selected={selected}
    tabs={[
      {
        label: (
          <NavLink to={'/home'} onClick={() => handleTabChange(0)}>
            Home
          </NavLink>
        ),
        children: (
          <Routes>
            <Route path="/home" element={<div>Home page</div>} />
          </Routes>
        ),
      },
      {
        label: (
          <NavLink to={'/about'} onClick={() => handleTabChange(1)}>
            About
          </NavLink>
        ),
        children: (
          <Routes>
            <Route path="/about" element={<div>About page</div>} />
          </Routes>
        ),
      },
    ]}
  />
</BrowserRouter>
1.2.7

5 days ago

1.2.6

20 days ago

1.2.5

1 month ago

1.2.4

3 months ago

1.2.3

3 months ago

1.2.2

3 months ago

1.2.1

3 months ago

1.2.0

4 months ago

1.1.4

4 months ago

1.1.3

5 months ago

1.1.2

5 months ago

1.1.1

6 months ago

1.1.0

8 months ago

1.0.0

9 months ago

0.1.5

10 months ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.0

2 years ago

0.0.0

2 years ago