Crate leptos_transition_flip

Source
Expand description

Allows FLIP transitions between element positions by using provided NodeRefs from the Leptos crate.

Enums§

ClearError
Might occur when clearing the styles of elements from the given node references. The single variant, CouldNotGetHtmlElement(Vec<T>), contains all IDs for which elements could not be obtained from the given node references.
FlipError
Errors that might occur when FLIPping elements. Its variants and respective purposes are as follows:
PrepareFlipError
Might occur when attempting to prepare a FLIP. When trying to obtain the position for a given element, if it is not possible to get it from the node reference, will return a vector of all IDs for which this is the case.

Functions§

prepare_flip
Main function of this crate. Returns a Result whose Ok is a pair of closures, (flip, clear), which performs the transition when an element’s position is changed, and clears the styles of the transitioned elements, respectively. The Err variant contains a PrepareFlipError, whose single variant is a CouldNotGetHtmlElement, which itself contains a Vec with all IDs for which getting an element was not possible. The reason why prepare_flip has to calculate the positions of the elements is to store them for later comparison with the new positions, and calculation of the element’s offset for the FLIP transition.