2.0.0 • Published 2 years ago

mui-tree-selects v2.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Mui-Tree-Selects

使用 Mui Tree 搭配 checkbox 實現樹狀多選單

install

npm

npm install mui-tree-selects

yarn

yarn add mui-tree-selects

Props

props功能
iconDirection調整按鈕位置
collapseIcon收合時的 icon
expandIco展開時的 icon
treeData樹狀資料
selectNode已選擇的節點
setSelectNode選取節點的 function (???)
iconReverseicon 顯示在後方,預設為 false => UIUX 怪怪的
checkboxColorcheckbox 顏色,可自定義 => (border 可調整??)
expanded可點擊的節點 (使用者自控) => 待補
wrapperBorder最外層的 border 樣式

有想加的 props 都歡迎發 PR

treeData 格式

export type TreeData = {
  name: string
  id: string
  parent?: string
  children?: TreeData[]
}

使用

import React from 'react'

import { MuiTreeSelect } from 'mui-tree-selects'

import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
import ChevronRightIcon from '@mui/icons-material/ChevronRight'

import data from './fakeData.json'

const App = () => {
  return (
    <MuiTreeSelect
      treeData={data}
      collapseIcon={<ExpandMoreIcon />}
      expandIcon={<ChevronRightIcon />}
      iconReverse={true}
    />
  )
}

export default App
2.0.0

2 years ago

1.0.0

2 years ago

0.0.11-beta.0

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago