You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-chrome-tabs

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-chrome-tabs

react chrome tabs

2.0.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

React Chrome Tabs

React Chrome Tabs 是基於 adamschwartzchrome-tabs 的 React 版本

Oneline Demo

上面連結是 React Chrome Tabs 的基本展示

Install

必要套件

  • react: >=16.8.0
  • react-dom: >=16.8.0
  • prop-types: ^15.8.1

Install React Chrome Tabs

npm i react-chrome-tabs --save

Usage

import React, { useState } from 'react'
import { render } from 'react-dom'
import ChromeTabs from 'react-chrome-tabs'

let [tabs, setTabs] = useState([
  { key: 0, favicon: "https://raw.githubusercontent.com/adamschwartz/chrome-tabs/gh-pages/demo/images/google-favicon.ico", title: "Google" },
  { key: 1, favicon: "https://raw.githubusercontent.com/adamschwartz/chrome-tabs/gh-pages/demo/images/facebook-favicon.ico", title: "Facebook" },
  { key: 2, favicon: "https://it108.wke.csie.ncnu.edu.tw/edu.ico", title: "IT Technology" }
])

render(
    <ChromeTabs 
      currentTabs={tabs}
      onChange={tabs => setTabs(tabs)}
    />
    , document.getElementById('root')
)

PROPS & METHODS

Prop nameTypeDefaultDescription
classNamestring
darkboolfalse
defaultCurrentnumber
currentTabsarray[]分頁陣列 e.g. [{key: "num or str", "favicion": "url", "title": "title"}]
onChangefunc(tabs) => {}
onClickfunc(key) => {}
onClosefunc(key) => {}
styleobject{}

Change Log

2.0.1

  • defaultTabs => currentTabs
  • 內部component不再控制tabs (都由onChange傳到外層變化currentTabs)

Keywords

react

FAQs

Package last updated on 22 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.