2

I want to animate my component like below (showing up new Container from bottom and Stack on the previous container) when user click the button.

Image from Gyazo

After researching few libraries, I noticed React Spring might be a good way to achieve Stack component and animation, but I haven't used this library so not sure if this is the best way.

I currently have simple component like below with a clickable button - what is the best way to achieve Stack like animation? I am using React/Typescript, ReactHooks and Tailwind CSS.

export const HomeLaunchShop: FC = () => {
    <div>
                    <form>
                        <div>
                            <a>This is first container</a>
                        </div>
                        <div>
                            <input
                                className={s.input}
                                name="phone"
                                type="tel"
                                maxLength={13}
                                value="xxx-xxxx-xxxx"
                                readOnly
                            />
                        </div>
                    </form>
                </div>
                <div>
                    <Button
                        title={'Try Payment'}
                        onClick={() => {}}
                    />
                </div>
            </div>
}
husky
  • 831
  • 3
  • 10
  • 24

0 Answers0