Layout Components
Application structure and navigation components
Layout Components Overview
Layout components define the overall structure and navigation of the DesQTA application. These components are located in src/lib/components/ and handle app-wide concerns like headers, sidebars, and navigation.
Main Layout Components
AppHeader
The main application header with navigation, search, and user controls.
Props:
sidebarOpen:boolean- Sidebar visibility stateweatherEnabled:boolean- Show weather widgetweatherData:any- Weather data objectuserInfo:UserInfo | undefined- Current user informationshowUserDropdown:boolean- User dropdown visibilityonToggleSidebar:() => void- Toggle sidebar callbackonToggleUserDropdown:() => void- Toggle user dropdown callbackonLogout:() => void- Logout callbackonShowAbout:() => void- Show about modal callbackdisableSchoolPicture:boolean- Hide school picture
Features:
- Global search
- Sidebar toggle
- Weather widget
- User dropdown
- Window controls (minimize, maximize, close)
- Notification bell
- Pages menu
AppSidebar
Navigation sidebar with menu items and collapsible sections.
Props:
open:boolean- Sidebar visibilitycurrentPath:string- Current route path
Features:
- Collapsible navigation
- Active route highlighting
- Icon support
- Nested menu items
- Keyboard navigation
PagesMenu
Dropdown menu for quick navigation to main pages.
Menu Items:
- Dashboard
- Assessments
- Timetable
- Messages
- Courses
- Study
- Folios
- Settings
UserDropdown
User profile dropdown with account options.
Props:
userInfo:UserInfo | undefined- User informationopen:boolean- Dropdown visibilityonLogout:() => void- Logout callbackonShowProfile:() => void- Show profile callbackonShowSettings:() => void- Show settings callback
Menu Items:
- Profile
- Settings
- About
- Logout
Navigation Components
ProfileSwitcher
Component for switching between user profiles (if multiple profiles are available).
Props:
profiles:Profile[]- Available profilescurrentProfile:Profile | null- Currently active profileonSwitch:(profile: Profile) => void- Profile switch callback
LanguageSelector
Language selection component for i18n.
Props:
currentLanguage:string- Current language codeavailableLanguages:string[]- Available language codesonChange:(lang: string) => void- Language change callback
Search Components
GlobalSearchOptimized
Optimized global search component with debouncing and result caching.
Props:
open:boolean- Search modal visibility (usebind:open)query:string- Search query (usebind:query)
Features:
- Debounced search
- Result caching
- Keyboard shortcuts (Ctrl+K / Cmd+K)
- Recent searches
- Quick actions
SearchModal
Modal wrapper for the search interface.
Props:
open:boolean- Modal visibility (usebind:open)
Widget Components
WeatherWidget
Weather display widget for the header.
Props:
weatherData:WeatherData- Weather information
WeatherData Interface:
ShortcutsWidget
Keyboard shortcuts reference widget.
Props:
open:boolean- Widget visibility (usebind:open)
Shortcuts:
Ctrl/Cmd + K: Global searchCtrl/Cmd + B: Toggle sidebarCtrl/Cmd + ,: SettingsEsc: Close modals
WelcomePortal
Welcome screen shown on first launch or when logged out.
Props:
onLogin:() => void- Login callback
Modal Components
Modal
Base modal component for dialogs and overlays.
Props:
open:boolean- Modal visibility (usebind:open)title:string- Modal titlesize:'sm' | 'md' | 'lg' | 'xl' | 'full'- Modal sizeclosable:boolean- Show close buttononClose:() => void- Close callbackchildren:Snippet- Main contentfooter:Snippet- Footer content
AboutModal
About dialog showing app information and version.
Props:
open:boolean- Modal visibility (usebind:open)
Displays:
- App name and version
- License information
- Credits
- Links to documentation
CloudSyncModal
Modal for managing cloud sync settings.
Props:
open:boolean- Modal visibility (usebind:open)
Features:
- Enable/disable sync
- Sync status
- Last sync time
- Manual sync trigger
TroubleshootingModal
Modal with troubleshooting information and diagnostics.
Props:
open:boolean- Modal visibility (usebind:open)
Features:
- Common issues and solutions
- Diagnostic information
- Log viewer
- Reset options
MenuOrderDialog
Dialog for customizing menu item order.
Props:
open:boolean- Dialog visibility (usebind:open)menuItems:MenuItem[]- Menu items to reorder
Features:
- Drag and drop reordering
- Save/cancel actions
- Reset to default
Onboarding Components
Onboarding
First-time user onboarding flow.
Props:
open:boolean- Onboarding visibility (usebind:open)onComplete:() => void- Completion callback
Steps:
- Welcome
- Features overview
- Settings setup
- Quick tour
Layout Patterns
Standard Page Layout
Modal Layout
Full-Screen Layout
Responsive Behavior
Mobile Layout
On mobile devices:
- Sidebar becomes a drawer
- Header adjusts for smaller screens
- Modals become full-screen
- Navigation uses bottom tabs
Desktop Layout
On desktop:
- Sidebar is always visible (can be collapsed)
- Header shows all controls
- Modals are centered
- Navigation uses sidebar
Best Practices
- Consistent Layout: Use the standard layout pattern for all pages
- Responsive Design: Ensure layouts work on all screen sizes
- Keyboard Navigation: Support keyboard shortcuts for common actions
- Accessibility: Include proper ARIA labels and roles
- State Management: Keep layout state at the appropriate level
- Performance: Lazy load heavy components like modals
Next Steps
- Common Components - Reusable UI components
- Feature Components - Domain-specific components
- Helper Components - Helper components