06. The `slideFrom` variant
🐇 TL;DR
- We’ve got
sizeandtonevariants going now! - Let’s implement one more style variant with the
slideFromprop
🐢 Background
We want to bring one more customisation option for our Modal: the direction it slides from when appearing.
Here’s our slideFrom prop type:
type ModalProps = {
// ...
slideFrom: 'top' | 'right' | 'bottom' | 'left'
}
The Record annotation on the slideFromClasses object will help you figure out the shape of the styles lookup you should create.
🏆 Your challenge 🏆
In the Gitpod workspace below:
-
Populate the
slideFromClasseslookup object. -
Update the
Modalcode to make use of these dynamicslideFromClassesTailwind utilities.
✌️ Good luck!
Open in Gitpod →