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

@synerise/ds-card-tabs

v0.16.17

Published

CardTabs UI Component for the Synerise Design System

Downloads

301

Readme


id: card-tabs title: CardTabs

CardTabs UI Component

Installation

npm i @synerise/ds-card-tabs
or
yarn add @synerise/ds-card-tabs

Usage

import CardTabs from '@synerise/ds-card-tabs'

<CardTabs
    maxTabsCount={4}
    onChangeOrder={() => {})}
    onAddTab={() => {})}
>
    <CardTab
        id={0}
        index={0}
        name="Variant A"
        tag="A"
        active={true}
        greyBackground={false}
        prefixIcon={<FileIcon />}
        suffixIcon={<FileIcon />}
        disabled={false}
        prefix={prefixType.TAG}
        onSelectTab={() => {})}
        onChangeName={() => {})}
        onRemoveTab={() => {}}
        onDuplicateTab={() => {})}
        invalid={false}
        draggable={false}
    />
    <CardTab
        id={1}
        index={1}
        name="Variant B"
        tag="B"
        active={false}
        greyBackground={false}
        prefixIcon={<FileIcon />}
        suffixIcon={<FileIcon />}
        disabled={false}
        prefix={prefixType.TAG}
        onSelectTab={() => {})}
        onChangeName={() => {})}
        onRemoveTab={() => {}}
        onDuplicateTab={() => {})}
        invalid={false}
        draggable={false}
    />
</CardTabs>

Demo

API

CardTabs Component

| Property | Description | Type | Default | | ------------- | ---------------------------------------------- | ------------------ | ------- | | maxTabsCount | Max number of child components | number | - | | onAddTab | Callback fired when user clicks on add button | function | - | | onChangeOrder | Callback fired when user changes order of tabs | function(newOrder) | - |

CardTab Component

| Property | Description | Type | Default | | -------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | -------- | | id | Id of tab | number | - | | index | Position of tab | number | - | | name | Name of tab | string | - | | tag | Single letter (tag) of tab | string | - | | addTabLabel | set text into add tab button | string | - | | active | Flag of active tab | boolean |false | | greyBackground | Change default color of tabs, use when background will be different then white | boolean |false | | prefixIcon | Icon visible on the left side of the tab | SVG Icon | null | | suffixIcon | Icon visible on the right side of the tab, when set action icons will be hidden | SVG Icon | null | | disabled | Flag of disabled tabs | boolean |false | | invalid | Flag of tabs with some errors | boolean |false | | invalidName | Flag of tabs with invalid name | boolean |false | | draggable | Shows drag handler on the left side of tab | boolean |false | | onSelectTab | Callback fired when user clicks on the tab | (id: number) => void | - | | onPreviewTab | Callback fired when user clicks on the preview tab icon | (id: number) => void | - | | onRemoveTab | Callback fired when user clicks on the remove tab icon | (id: number) => void | - | | onDuplicateTab | Callback fired when user clicks on the duplicate tab icon | (id: number) => void | - | | onChangeName | Callback fired when the edit name input blur | (id: number, newName: string) | - | | texts | Translations of CrudButtons tooltips | CardTabTexts | - | | color | Color of CardTab | red/ green/ grey/ yellow/ blue/ pink/ mars/ orange/ fern/ cyan/ purple/ violet | yellow | | colorDot | single color dot | React.ReactNode | - | | itemData | Additional item data | any | - | | renderSuffix | render custom suffix instead of cruds, dropdown menu or icon | (props: CardTabSuffixProps) => ReactNode | - | | actionsAsDropdown | render crud actions in dropdown instead of icons | boolean | false |

CardTabTexts

| Property | Description | Type | Default | | ----------------- | ----------------- | ------------------------ | ----------- | | changeNameTooltip | Rename tooltip | string / React.ReactNode | 'Rename' | | duplicateTooltip | Duplicate tooltip | string / React.ReactNode | 'Duplicate' | | previewTooltip | Remove tooltip | string / React.ReactNode | 'Remove' | | removeTooltip | Remove tooltip | string / React.ReactNode | 'Remove' | | changeNameMenuItem | Rename menu label | string / React.ReactNode | 'Rename' | | duplicateMenuItem | Duplicate menu label | string / React.ReactNode | 'Duplicate' | | removeMenuItem | Remove menu label | string / React.ReactNode | 'Remove' |