Intercode SaaS Kit
  • Welcome to SaaS Starter Kit
  • Getting Started
    • Technology stack
    • Database Setup
    • Local Environment Setup
  • Basics
    • Dependencies
    • App architecture
    • Deployment
    • App roles
    • Endpoints List
      • Auth
      • Two Factor Auth
      • Businesses
      • Demo
      • Email
      • Export Document
      • Email Files
      • Files Demo
      • Leads
      • Orders
      • Payments
      • Subscriptions
      • Teams
      • Team Memberships
      • User Admin
  • Animation and Styles
    • Framer Motion
    • Ant Design and Styles
  • Pages
    • Auth
      • Working with PassportJS
      • Two-Factor Auth
      • OAuth Providers
    • Leads
    • Businesses
    • Team management
      • Ownership
    • Profile
    • User Settings
      • App Tour
    • App Settings
      • Lead Statuses
    • Dashboard
      • Lead volume widget
      • Doughnut chart widget
      • Recent leads table widget
      • Lead count over period widget
    • Demo
  • Features
    • Impersonation
    • Subscriptions (Stripe)
    • Search
    • Sentry
    • Captcha
    • Audit Logs
    • Internationalization
  • External integrations
    • Mailer
    • Google oAuth2
    • Facebook oAuth2
    • S3 compatible storage (AWS, MinIO)
Powered by GitBook
On this page
  • Credits
  • Requirement
  • Example
  • Helpers
  1. Animation and Styles

Framer Motion

Here you will find the information on how we used animations from this library.

PreviousUser AdminNextAnt Design and Styles

Last updated 5 months ago

Credits

All the base examples of the animations and overall how this work you can find on their official documentation .

In this block we just briefly take a look how this animation set in our project.

Requirement

First of all we need to install package:

"framer-motion": "^11.3.2",

Example

In file we import:

import { AnimatePresence, motion } from 'framer-motion';

N.B. AnimatePresence not always necessary.

Base usage on example in Lead Statuses Settings:

<motion.div key="edit" {...statusesForm} className="tour-statuses-list">
        <DndContext sensors={sensors} collisionDetection={closestCorners} onDragEnd={handleDragEnd}>
                <StatusesList statuses={statuses} />
        </DndContext>
</motion.div>

or more complicated example just lower in the code:

<AnimatePresence mode="wait">
                {mode === 'edit' && (
                    <motion.div key="edit" {...statusesForm}>
                        <EditStatus
                            t={t}
                            statuses={statuses}
                            colors={colors}
                            handleUpdateStatus={handleUpdateStatus}
                            handleOpenDeleteModal={handleOpenDeleteModal}
                            loading={loading}
                        />
                    </motion.div>
                )}
                {mode === 'add' && (
                    <motion.div key="add" {...statusesForm}>
                        <AddStatus t={t} colors={colors} handleCreateStatus={handleCreateStatus} loading={loading} />
                    </motion.div>
                )}
</AnimatePresence>

From this example we can understand that render switches on display based on different conditions. Animation make experience of UI usage more smooth.

Helpers

You may notice this thing in component code:

{...statusesForm}

Such code you can find in .../ui/src/common/animationVariants/

As you can see, in that folder we stores other animation variants.

Just go there and try it!

here