npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@paprika/tabs

v2.3.11

Published

Tabs component displays tabs with panels associated with each tab

Downloads

3,455

Readme

@paprika/tabs

Description

Tabs component displays tabs with panels associated with each tab

Installation

yarn add @paprika/tabs

or with npm:

npm install @paprika/tabs

Props

Tabs

| Prop | Type | required | default | Description | | ------------------ | ----------------------------------------------------- | -------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | a11yText | string | false | null | Description of the purpose of the tabs for assistive technology. | | children | node | true | - | Expects Tabs.List (mandatory) and Tabs.Panels (optional). | | defaultIndex | number | false | undefined | Sets what tabindex is active by default (uncontrolled component). Use null for no active tab. | | hasInsetFocusStyle | bool | false | false | If the visual focus ring for the tabs should be displayed with an inset style. | | hasTruncation | bool | false | false | Tab labels will be truncated when they run out of space instead of breaking to multiple lines (ignored when isVertical is false). | | index | number | false | undefined | Sets what tabindex is active (controlled component). Use null for no active tab. | | isDisabled | bool | false | false | If the tabs are all disabled. | | isVertical | bool | false | false | If the tabs are stacked vertically. | | kind | [ Tabs.types.kind.PRIMARY, Tabs.types.kind.SECONDARY] | false | Tabs.types.kind.PRIMARY | The visual theme of the tabs list. | | onClickTab | func | false | null | Use this prop when you want to use Tabs as a controlled component (also you must use 'index' prop). When the user clicks on a tab, this gets fired (the tab index is passed to it). | | size | [ Tabs.types.size.MEDIUM, Tabs.types.size.LARGE] | false | Tabs.types.size.MEDIUM | Size of the tab label text. | | tabHeight | [number,string] | false | 48 | Height of the tabs (ignored when isVertical is true). A number value will be interpreted as height in pixels. |

Tabs.List

| Prop | Type | required | default | Description | | -------- | ---- | -------- | ------- | -------------------------- | | children | node | true | - | List of Tabs.Tab elements. |

Tabs.Panel

| Prop | Type | required | default | Description | | ------------- | ---- | -------- | ------- | ---------------------------------------------- | | children | node | false | null | | | isSelected | bool | false | false | Controls if the option is selected or not | | shouldUnmount | bool | false | true | Should unmount or not when isSelected is false |

Tabs.Panels

| Prop | Type | required | default | Description | | -------- | ---- | -------- | ------- | ---------------------------- | | children | node | true | - | List of Tabs.Panel elements. |

Tabs.Tab

| Prop | Type | required | default | Description | | --------------- | ------ | -------- | -------- | ------------------------------------------------------------------------------------------ | | a11yText | string | false | null | Descriptive text for assistive technologies. By default text of the children will be used. | | children | node | false | null | Label for the tab | | hasFocus | bool | false | false | Internal only: if tab has focus | | href | string | false | null | Sets a url the tab goes to | | isDisabled | bool | false | false | If the tab is disabled | | isSelected | bool | false | false | Internal only: if tab is selected | | onClick | func | false | () => {} | Internal only: callback onClick | | onKeyDownArrows | func | false | () => {} | Internal only: callback onKeyDownArrow |

Usage

import Tabs from "@paprika/tabs";

<Tabs>
  <Tabs.List>
    <Tabs.Tab>Hello</Tabs.Tab>
    <Tabs.Tab isDisabled>World</Tabs.Tab>
    <Tabs.Tab>ABC</Tabs.Tab>
    <Tabs.Tab isDisabled>Disabled Tab</Tabs.Tab>
  </Tabs.List>
  <Tabs.Panels>
    <Tabs.Panel>Hello Tab</Tabs.Panel>
    <Tabs.Panel>Disabled tab 2</Tabs.Panel>
    <Tabs.Panel>ABC Tab</Tabs.Panel>
    <Tabs.Panel>Disabled tab 4</Tabs.Panel>
  </Tabs.Panels>
</Tabs>;

Links