Overview
The Adaptive Sheet is a versatile component that adapts its presentation based on device: a swipeable bottom sheet on mobile and a side panel on desktop. It’s used throughout the site for portfolio details, contact forms, and content overlays. Source:~/workspace/source/shared/components/adaptive-sheet/adaptive-sheet.js
Key Features
Responsive Layout
Bottom sheet on mobile, side panel on desktop
Swipe Gestures
Touch-enabled drag-to-close on mobile devices
Keyboard Support
ESC key closes the sheet
Backdrop Overlay
Darkens background content when sheet is open
Architecture
The Adaptive Sheet uses a class-based architecture with state management:CLOSED- Sheet is hiddenOPEN- Sheet is fully visible
HTML Structure
Initialization
Opening the Sheet
Closing the Sheet
Touch Gestures
The sheet supports swipe-down-to-close on mobile:Viewport Adjustment
The sheet adapts its layout based on viewport size:Top Controls Dropdown
The sheet includes a dropdown menu in the top controls:CSS Variables
The sheet uses CSS variables for theming:Use Cases
- Portfolio Details
- Contact Form
- Quick Actions
Integration with Portfolio
The sheet is commonly used in portfolio pages:Best Practices
Always call init() before open()
Always call init() before open()
Initialize the sheet before opening it to ensure event listeners are attached.
Keep content focused
Keep content focused
The sheet is for quick views and actions. Don’t overload it with too much content.
Test touch gestures on real devices
Test touch gestures on real devices
Swipe gestures behave differently on actual touch devices vs. browser dev tools.
Provide clear close affordances
Provide clear close affordances
Always show a close button and backdrop. Users should have multiple ways to dismiss the sheet.
Related Components
Portfolio Grid
Uses Adaptive Sheet to display portfolio item details
Dynamic Island
Can trigger Adaptive Sheet for quick actions

