Coder Social home page Coder Social logo

Comments (2)

mreid21 avatar mreid21 commented on May 28, 2024 1
<Transition
  enterActiveClass="transition ease-in-out duration-1000"
  exitActiveClass="transition ease-in-out duration-1000"
  enterClass="opacity-0"
  enterToClass="opacity-1"
  exitToClass="opacity-0"
  <Show when={modalOpen()}>
	  ...
  </Show>
</Transition>

Per the documentation enter class is "CSS class applied to the entering element at the start of the enter transition, and removed the frame after. Defaults toΒ "s-enter"/." So you really want to apply the transition properties on enterActiveClass and leaveActiveClass. The code above will transition your search component from opacity 0 to 1 on enter and leave.

  • enterToClass is where you want it to end up when it transitions in.
  • exitToClass is where you want it to end up when it transitions out.

Someone can correct me if I'm skipping over any important details or caveats here.
Hope this helps!

from solid-transition-group.

blood1shot avatar blood1shot commented on May 28, 2024

@mreid21 solution works perfectly! Here is my code that uses css module

  <Portal>
    <Transition
      enterActiveClass={styles["fade--active"]}
      exitActiveClass={styles["fade--active"]}
      enterClass={styles["opacity-0"]}
      enterToClass={styles["opacity-1"]}
      exitToClass={styles["opacity-0"]}
    >
      <Show when={props.isOpen}>
        ...
      </Show>
    </Transition>
  </Portal>

from solid-transition-group.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.