• Stars
    star
    815
  • Rank 53,798 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🌲Simple to use, configurable tree view with full support for drop-in animations

Build Status npm version

npm install react-animated-tree

A simple, configurable tree view control for React.

Demo: https://codesandbox.io/embed/rrw7mrknyp

  • content, Name of the node (string or React-component)
  • type, optional description, good for displaying icons, too (string or React-component)
  • open, optional: default open state
  • canHide, optional: when set true displays an eye icon
  • visible, optional: default visible state
  • onClick, optional: click events on the eye
  • springConfig, optional: react-spring animation config
import Tree from 'react-animated-tree'

<Tree content="Apple" type="Fruit" open canHide visible onClick={console.log}>
  <Tree content="Contents">
    <Tree content="Seeds" />
  <Tree>
<Tree>

Create your own effects by passing a react-spring config. The config below is the default (items fade in while moving in 20px from the right). You can go wild here by rotating, flipping, etc.

config = open => ({
  from: { height: 0, opacity: 0, transform: 'translate3d(20px,0,0)' },
  to: {
    height: open ? 'auto' : 0,
    opacity: open ? 1 : 0,
    transform: open ? 'translate3d(0px,0,0)' : 'translate3d(20px,0,0)',
  },
})

const SpecialTree = props => <Tree {...props} springConfig={config} />

<SpecialTree content="Orange">
  <SpecialTree content="Juice" />
</SpecialTree>

More Repositories

1

react-springy-parallax

🌊 A springy, composable parallax-scroller for React - deprecated
JavaScript
1,328
star
2

mauerwerk

⚒ A react-spring driven masonry-like grid with enter/exit and shared element transitions
JavaScript
831
star
3

react-contextual

🚀 react-contextual is a small (less than 1KB) helper around React 16s new context api
JavaScript
643
star
4

the-substance

Scroll, Refraction and Shader Effects in Three.js and React
JavaScript
371
star
5

poimandres-theme

⚫️ poimandres vsc theme
JavaScript
218
star
6

floating-shoe

JavaScript
169
star
7

immer-wieder

✨ React 16 context wrap with redux semantics powered by immer
JavaScript
167
star
8

learnwithjason

Learn how to use theejs in react using react-three-fiber 🎉
JavaScript
121
star
9

reactanoid

JavaScript
98
star
10

testlighting

JavaScript
93
star
11

scheduler-test

JavaScript
56
star
12

r3fv4

Created with CodeSandbox
JavaScript
34
star
13

r3f-aesop

JavaScript
21
star
14

nft-gallery

Created with CodeSandbox
JavaScript
17
star
15

react-higher-order

☔️ Maps render props to a higher order component
JavaScript
16
star
16

untitled-game

Created with CodeSandbox
JavaScript
14
star
17

splats

TypeScript
13
star
18

arc-x-pmndrs

JavaScript
12
star
19

projects

projects
JavaScript
7
star
20

react-spring-numerical

🙌 React-springs leaner doppelgånger
JavaScript
7
star
21

awv3node-homepage

JavaScript
5
star
22

scroll-template

JavaScript
4
star
23

dom-resize

JavaScript
3
star
24

threeparcel

JavaScript
3
star
25

reacteurope

JavaScript
3
star
26

testsvg

2
star
27

plugs-draft

JavaScript
1
star
28

meshtransmissionmaterial

JavaScript
1
star
29

vite-three-js

JavaScript
1
star
30

zustand-website

CSS
1
star