Skip to content

Latest commit

Β 

History

History
368 lines (305 loc) Β· 8.89 KB

File metadata and controls

368 lines (305 loc) Β· 8.89 KB

Advanced UI Components Guide

🎨 Complete Advanced UI System for Vacafy

This guide covers all the premium UI components created for your travel app. Each component is designed with modern design principles including glassmorphism, neumorphism, advanced animations, and premium interactions.

πŸ“ Component Categories

1. Core Design System

  • AdvancedTheme (src/styles/advancedTheme.ts)
    • Advanced color palettes with gradients
    • Sophisticated shadows with colored variants
    • Comprehensive spacing and typography scales
    • Animation configurations and component styles

2. Basic Premium Components

PremiumButton - 7 variants with animations

import { PremiumButton } from '../components/advanced';

<PremiumButton 
  title="Premium Action" 
  variant="ai" 
  size="lg" 
  loading={isLoading}
  onPress={handlePress} 
/>

Variants: primary, secondary, ai, glass, outline, ghost, gradient

PremiumCard - 7 sophisticated designs

import { PremiumCard } from '../components/advanced';

<PremiumCard variant="glass" size="lg" onPress={handlePress}>
  <Text>Card content with glassmorphism</Text>
</PremiumCard>

Variants: default, gradient, glass, premium, ai, hero, floating

LoadingSpinner - 5 animation types

import { LoadingSpinner } from '../components/advanced';

<LoadingSpinner variant="gradient" size="lg" />

Variants: spinner, dots, pulse, wave, gradient

3. Layout & Navigation Components

AnimatedHeader - Parallax scrolling header

import { AnimatedHeader } from '../components/advanced';

<AnimatedHeader
  title="Welcome"
  subtitle="Your premium experience"
  scrollY={scrollY}
  height={250}
  gradientColors={AdvancedTheme.colors.primary.gradient}
/>

BottomNavigation - Premium navigation bar

import { BottomNavigation } from '../components/advanced';

<BottomNavigation
  items={navigationItems}
  activeKey={currentRoute}
  variant="premium"
/>

TabNavigator - Advanced tab system

import { TabNavigator } from '../components/advanced';

<TabNavigator
  tabs={tabItems}
  variant="premium"
  onTabChange={handleTabChange}
/>

4. Interactive Components

SwipeableCard - Gesture-based interactions

import { SwipeableCard } from '../components/advanced';

<SwipeableCard
  leftAction={{
    icon: 'archive',
    color: 'white',
    backgroundColor: '#ff9500',
    onPress: handleArchive,
  }}
  rightAction={{
    icon: 'favorite',
    color: 'white', 
    backgroundColor: '#ff3b30',
    onPress: handleFavorite,
  }}
>
  <YourCardContent />
</SwipeableCard>

AnimatedInput - Premium form inputs

import { AnimatedInput } from '../components/advanced';

<AnimatedInput
  label="Email Address"
  icon="email"
  variant="premium"
  error={emailError}
  onChangeText={setEmail}
/>

PullToRefresh - Custom refresh mechanism

import { PullToRefresh } from '../components/advanced';

<PullToRefresh onRefresh={handleRefresh} refreshing={isRefreshing}>
  <YourContent />
</PullToRefresh>

5. Advanced Layout Components

NeumorphicCard - Soft UI design

import { NeumorphicCard } from '../components/advanced';

<NeumorphicCard variant="raised" size="lg" onPress={handlePress}>
  <YourContent />
</NeumorphicCard>

Variants: raised, pressed, flat

GlassmorphicContainer - Modern glass effects

import { GlassmorphicContainer } from '../components/advanced';

<GlassmorphicContainer 
  intensity="high" 
  tint="primary"
  borderRadius={20}
>
  <YourContent />
</GlassmorphicContainer>

Intensities: low, medium, high Tints: light, dark, primary, secondary

ParallaxScrollView - Multi-layer scrolling

import { ParallaxScrollView } from '../components/advanced';

<ParallaxScrollView
  headerHeight={300}
  headerComponent={<YourHeader />}
  parallaxLayers={[
    { component: <Layer1 />, speed: 0.5 },
    { component: <Layer2 />, speed: 0.8 },
  ]}
  gradientColors={gradientColors}
>
  <YourContent />
</ParallaxScrollView>

6. Action & Menu Components

FloatingActionButton - Enhanced FAB

import { FloatingActionButton } from '../components/advanced';

<FloatingActionButton
  icon="add"
  variant="ai"
  size="lg"
  badge={3}
  position={{ bottom: 24, right: 24 }}
  onPress={handlePress}
/>

FloatingMenu - Expandable action menu

import { FloatingMenu } from '../components/advanced';

<FloatingMenu
  items={menuItems}
  mainIcon="menu"
  variant="primary"
  position={{ bottom: 24, right: 24 }}
/>

ActionSheet - Modal action selector

import { ActionSheet } from '../components/advanced';

<ActionSheet
  visible={isVisible}
  onClose={handleClose}
  title="Choose Action"
  actions={actionItems}
  variant="premium"
/>

πŸš€ Implementation Examples

Complete Screen with Premium Components

import React from 'react';
import { View } from 'react-native';
import {
  ParallaxScrollView,
  PremiumCard,
  PremiumButton,
  FloatingActionButton,
  BottomNavigation,
} from '../components/advanced';

export default function PremiumScreen() {
  return (
    <View style={{ flex: 1 }}>
      <ParallaxScrollView
        headerHeight={250}
        headerComponent={<YourHeader />}
        gradientColors={['#667eea', '#764ba2']}
      >
        <View style={{ padding: 16 }}>
          <PremiumCard variant="hero" size="lg">
            <PremiumButton 
              title="Book Now" 
              variant="ai" 
              size="lg" 
              fullWidth 
            />
          </PremiumCard>
        </View>
      </ParallaxScrollView>
      
      <FloatingActionButton
        icon="search"
        variant="secondary"
        position={{ bottom: 100, right: 24 }}
      />
      
      <BottomNavigation
        items={navItems}
        activeKey="home"
        variant="premium"
      />
    </View>
  );
}

Form with Advanced Inputs

<View>
  <AnimatedInput
    label="Destination"
    icon="place"
    variant="premium"
    value={destination}
    onChangeText={setDestination}
  />
  
  <AnimatedInput
    label="Travel Dates"
    icon="date-range"
    variant="glass"
    value={dates}
    onChangeText={setDates}
  />
  
  <PremiumButton
    title="Search Flights"
    variant="gradient"
    size="lg"
    fullWidth
    loading={isSearching}
    onPress={handleSearch}
  />
</View>

🎨 Design Principles

Visual Hierarchy

  • Hero Elements: Use hero variant cards for main CTAs
  • Content Cards: Use premium or glass for content sections
  • Interactive Elements: Use animated buttons with appropriate variants

Color Usage

  • Primary: Main brand actions and navigation
  • Secondary: Supporting actions and information
  • AI: Special AI-powered features and recommendations
  • Success/Warning/Danger: Status and feedback indicators

Animation Guidelines

  • Entrance: Use staggered animations with appropriate delays
  • Interaction: Spring-based animations for natural feel
  • Scroll: Parallax and scroll-based animations for engagement
  • Micro-interactions: Subtle feedback for all touch interactions

Accessibility

  • All components include proper touch targets (minimum 44px)
  • Color contrast meets WCAG guidelines
  • VoiceOver/TalkBack support included
  • Proper semantic labeling for screen readers

πŸ“± Screen Integration Examples

Home Screen Enhancement

// Replace basic HomeScreen with PremiumHomeScreen
import { PremiumHomeScreen } from '../screens/premium';

Authentication Flow

// Use PremiumAuthScreen for login/signup
import { PremiumAuthScreen } from '../screens/premium';

Component Showcase

// Demo all components
import AdvancedComponentsDemo from '../screens/AdvancedComponentsDemo';

πŸ›  Performance Tips

  1. Animation Performance

    • Use runOnUI for complex calculations
    • Minimize re-renders with proper memoization
    • Use useSharedValue for animation values
  2. Memory Management

    • Lazy load heavy components
    • Clean up animations on unmount
    • Use InteractionManager for delayed operations
  3. Rendering Optimization

    • Use FlatList for large datasets
    • Implement proper keyExtractor functions
    • Optimize image loading and caching

🎯 Next Steps

  1. Integration: Replace existing screens with premium versions
  2. Customization: Adjust colors and spacing to match brand
  3. Testing: Test on different devices and screen sizes
  4. Performance: Profile and optimize animations
  5. Accessibility: Test with screen readers and accessibility tools

This advanced UI system transforms your Vacafy app into a premium, modern travel application with sophisticated design and smooth interactions that will significantly enhance user engagement and satisfaction.