The Frame component provides an elegant container for displaying images, videos, or interactive content with a decorative grid pattern background and optional title and description.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mintlify/components/llms.txt
Use this file to discover all available pages before exploring further.
Basic Usage
Props
The HTML element type to render as the frame container. Currently only supports
"div".Optional title displayed above the frame with a hand pointer icon. Useful for providing context or hints.
Optional description text displayed below the frame content. Useful for captions or additional context.
Custom render function for the description. Receives the description string and returns a ReactNode.Default implementation:
(text) => <p>{text}</p>Inline CSS styles to apply to the frame container. Commonly used for setting dimensions.
Additional CSS classes to apply to the outer frame container.
The content to display inside the frame. Can be images, videos, or any React elements.
Examples
Basic Frame
With Title (Hint)
With Description
With All Features
Custom Dimensions
With Video Content
The Frame component automatically enhances video elements with additional props for better compatibility and user experience.
With Interactive Content
With Custom Description Rendering
Multiple Frames
Responsive Frame
Custom Background
Visual Design
The Frame component includes several visual elements:Background Pattern
A decorative grid pattern in the background:- Light mode: Subtle stone-colored grid
- Dark mode: Semi-transparent white grid
- Creates depth and visual interest
- Automatically masks at the bottom for a fade effect
Frame Border
A subtle border overlay that:- Light mode: Black with 5% opacity
- Dark mode: White with 5% opacity
- Provides definition without being distracting
Content Container
The inner content area:- White background in light mode
- Dark stone background in dark mode
- Rounded corners for a polished look
- Centered content by default
Title Icon
When a title is provided, a hand pointer icon appears:- Indicates interactivity or important information
- Stone-colored in both light and dark modes
- Positioned to the left of the title text
Styling
The Frame automatically adapts to light and dark themes. Customize appearance using theclassName and style props:
Common Customizations
Video Enhancement
The Frame component automatically enhances video elements by:- Setting optimal attributes for autoplay and looping
- Ensuring proper aspect ratios
- Adding mobile-friendly controls
- Optimizing for performance
Video enhancement is handled automatically via the
enhanceVideoProps utility function.Use Cases
Product Screenshots
Tutorial Steps
Before/After Comparisons
Code Output Visualization
Embedded Demos
Accessibility
The Frame component maintains accessibility:- Semantic HTML structure
aria-hidden="true"on decorative elements- Proper content ordering for screen readers
- Support for image alt text
- Focus management for interactive content
Best Practices
- Set dimensions: Use
styleprop to set explicit width/height for consistent layouts - Provide context: Use
titlefor hints anddescriptionfor captions - Optimize images: Use appropriately sized images to avoid performance issues
- Alt text: Always include descriptive alt text for images
- Responsive design: Use className to make frames responsive on different screen sizes