Core Concepts

Understanding transitions, decorators, and screens in Flemo

Screen

The Screen component is the foundation of Flemo. Every page component must be wrapped with Screen to enable smooth transitions.

RequiredScreen Wrapper
Essential wrapper component for all page components
• Provides transition context for animations
• Manages screen lifecycle and state
• Enables gesture-based navigation
• Required for all page components
// Every page must use Screen
import { Screen } from "flemo"
function HomePage() {
return (
<Screen>
<h1>Welcome to Home</h1>
</Screen>
)
}

Transition

Transition defines how screens move during navigation. They control the animation between the current screen and the next screen.

Built-inCupertino
iOS-style slide transitions with smooth easing
• Horizontal slide animations
• Native iOS feel
• Gesture support
Built-inMaterial
Android-style transitions with material design principles
• Elevation-based animations
• Material Design feel
• Shared element transitions
Built-inNone
Instant navigation without animations
• No transition animations
• Immediate screen changes
• Performance optimized

Decorator

Decorator adds visual enhancements on top of transitions. They create additional layers of animation that complement the main screen transition.

Built-inOverlay
Adds a dimming overlay effect during transitions
• Darkens background during navigation
• Works with Cupertino transition
• Enhances depth perception

How They Work Together

1. Screen Setup

Each page wrapped in Screen component

2. Navigation

User navigates to a new route

3. Transition

Screens animate according to transition rules

4. Enhancement

Decorators add visual effects

Ready to Get Started?

Now that you understand the core concepts, let's implement them in your project.