What are SmarterElements?
SmarterElements are iframe-based UI components that provide:- Iframe Isolation: Components run in isolated contexts for security
- Automatic Resizing: Content-driven sizing with smooth transitions
- Modal System: Overlay display with backdrop blur and focus management
- Event Communication: Bidirectional messaging between parent and element
- Size Constraints: Flexible width/height limits with CSS unit support
Key Features
- Secure Isolation: Each element runs in its own iframe sandbox
- Modal & DOM Mounting: Display elements inline or as overlay modals
- Auto-Resizing: Elements automatically adjust to content size
- React Integration: Dedicated hooks and components for React apps
- CDN Ready: Direct script inclusion without build tools
- Utility Functions: Built-in debounce and throttle for performance
- TypeScript Support: Full type definitions included
Architecture
Element Types
- BlockKit Renderer: Dynamic UI rendering from JSON configurations
- Custom Elements: Application-specific components
- Modal Elements: Overlay components with backdrop and focus management
Integration Patterns
- DOM Mounting: Embed elements directly into existing containers
- Modal Display: Show elements as overlay modals with auto-sizing
- React Components: Use dedicated React hooks and components
- Vanilla JavaScript: Direct API usage without frameworks
