File Tree
Display a list of files and folders in a hierarchical tree structure.
Basic
All folders and files are sorted automatically.
Imperative
Use props value
to show more complex file tree.
Extra Message
Use props value
to show more complex file tree.
Event
Path will be reported when file is clicked.
APIs
Tree.Props
Attribute | Description | Type | Accepted values | Default |
---|---|---|---|---|
value | value of files | Array<FileTreeValue> | - | - |
initialExpand | expand by default | boolean | - | false |
onClick | click file event | (path: string) => void | - | - |
... | native props | HTMLAttributes | 'id', 'title', 'className', ... | - |
Tree.File.Props
Attribute | Description | Type | Accepted values | Default |
---|---|---|---|---|
name(required) | file name | string | - | - |
extra | extra message | string | - | - |
... | native props | HTMLAttributes | 'id', 'title', 'className', ... | - |
Tree.Folder.Props
Attribute | Description | Type | Accepted values | Default |
---|---|---|---|---|
name(required) | folder name | string | - | - |
extra | extra message | string | - | - |
... | native props | HTMLAttributes | 'id', 'title', 'className', ... | - |
type FileTreeValue
type FileTreeValue = {
type: 'directory' || 'file'
name: string
extra?: string
files?: Array<FileTreeValue>
}
Contributors