Skip to content

Instantly share code, notes, and snippets.

@jcblw
Created February 7, 2016 09:01
Show Gist options
  • Save jcblw/91c73566b526aa38dfbb to your computer and use it in GitHub Desktop.
Save jcblw/91c73566b526aa38dfbb to your computer and use it in GitHub Desktop.

Visual continuity component

This is a concept in material design that helps define meaningful and easy to follow transitions in user interfaces

I had the idea to do this transition in react components. The basics of the transition is to take a piece of ui and transfer it over to the new state of the ui without losing some type of visual que of the element that is shared.

Intergration with react.

Pesuado code.

return (
  <div>
    <VisCont context={this} originRef='component1' targetRef='component2' />
    <CSSTransitionGroup>
      {isStep1 ? 
        <div ref='component1'></div>:
        <div ref='component2'></div>
      }
    </CSSTransitionGroup>
  </div>
)

The idea is that we can clone and cache component1 and then move it over component2 when the transition happens.

There is still alot of things to work out like how does the VisCont component know when to transition how to transition or if both refs are the same els.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment