06. The `slideFrom` variant
🐇 TL;DR
- We’ve got
size
andtone
variants going now! - Let’s implement one more style variant with the
slideFrom
prop
🐢 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
slideFromClasses
lookup object. -
Update the
Modal
code to make use of these dynamicslideFromClasses
Tailwind utilities.
✌️ Good luck!
Open in Gitpod →