2.0.1 • Published 1 year ago

react-chrome-tabs v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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)
2.0.1

1 year ago

2.0.0

1 year ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago