Reflex Motion
A Reflex wrapper for Framer Motion, a production-ready motion library for React.
Installation
pip install reflex-motion
Usage
Right now Reflex Motion is a simple wrapper around Framer Motion. It provides a single component, motion, which is a drop-in replacement for motion.div from Framer Motion.
motion(
rx.button(
"Bounce me!",
),
while_hover={"scale": 1.2},
while_tap={"scale": 0.9},
transition={"type": "spring", "stiffness": 400, "damping": 17},
)
There are a few different props motion supports:
Props
inital: The initial state of the animation. This is the state the animation will start in when the component is first rendered.
animate: The state the animation will end in. This is the state the animation will end in when the component is first rendered.
while_hover: The state the animation will be in while the user is hovering over the component.
while_tap: The state the animation will be in while the user is tapping on the component.
while_in_view: The state the animation will be in while the component is in view.
while_focus: The state the animation will be in while the component is focused.
Animation Props
| Name | Key | Values | Description |
|---|---|---|---|
| Translate | 'x', 'y', 'z' | int | The amount to translate the component by. |
| Scale | 'scale', 'scale_x', 'scale_y' | int | The amount to scale the component by. |
| Rotate | 'rotate', 'rotate_x', 'rotate_y', 'rotate_z' | int | The amount to rotate the component by. |
| Skew | 'skew', 'skew_x', 'skew_y' | int | The amount to skew the component by. |
Additionally you can pass in any Reflex style prop (css prop).
Transitions
transition: The transition to use when animating between states. This can be a single transition or an array of transitions.
| Name | Key | Values | Description |
|---|---|---|---|
| Type | 'tpye' | tween', 'spring', 'keyframes' | The type of transition to use. |
| Easing | 'ease' | 'linear', 'ease_in', 'ease_out', 'ease_in_out', 'circ_in', 'circ_out', 'circ_in_out', 'back_in', 'back_out', 'back_in_out' | The easing function to use for the transition. |
| Duration | 'duration' | int | The duration of the transition in milliseconds. |
| Delay | 'delay' | int | The delay before the transition starts in milliseconds. |
Additonally you can pass in any of the Animation Props and Reflex style prop (css prop).
Examples
Transition
motion(
rx.button(
"Spin me!",
variant="soft",
),
initial={"scale": 1},
while_hover={"scale": 1.2, "rotate": 45},
while_tap={"scale": 0.9},
transition={"type": "spring", "stiffness": 260, "damping": 20},
)
Metadata
Release files for reflex-motion 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| reflex-motion-0.0.1.tar.gz | 2.9 kB | Without provenance | Details for reflex-motion-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| reflex_motion-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for reflex_motion-0.0.1-py3-none-any.whl |
Total release size: 6.0 kB
Release files / reflex-motion-0.0.1.tar.gz
| Download URL | reflex-motion-0.0.1.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d404d270ae725fce8c8a2dd7c1dba4bbc4e821ac5858b25419cc27e56449e38
|
|
BLAKE2b-256 checksum How to use checksums |
8a8c85f74b9e5729448c7fc81f958f2a53d0757d31b80fcc88b13efb3c30018b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.6
|
Release files / reflex_motion-0.0.1-py3-none-any.whl
| Download URL | reflex_motion-0.0.1-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c76b47920ab6d979f9e93728108d97c9da41dad3fc239493f53fba17ae43202
|
|
BLAKE2b-256 checksum How to use checksums |
4b9e5c7c2f414fd77c3c3e229a2175223f3c89c8cca05c6ebefd1bd7c2d2ab2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.6
|
Security for reflex-motion 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.