Web Browser Component Examples
Basic Browserβ
A simple browser displaying a website:
Interactive Browserβ
A fully interactive browser with navigation controls (try clicking the navigation buttons and changing the URL):
Mock Content Browserβ
Perfect for showing website previews without external dependencies:
Welcome to Our Platform
Build amazing applications with our tools
Getting Started
Our platform provides everything you need to build modern web applications. Start with our comprehensive documentation and examples.
Features
Includes authentication, database integration, real-time updates, and deployment tools. Scale from prototype to production seamlessly.
Community
Join thousands of developers building with our platform. Get help, share ideas, and contribute to our open source projects.
Custom Content Browserβ
Display custom React content inside the browser frame:
API Reference
Authentication
Content-Type: application/json
{ "email": "user@example.com", "password": "securepassword" }
Response
Mobile Browserβ
Optimized for mobile viewing:
Minimal Browserβ
Clean browser without navigation controls:
Direct Component Usageβ
You can also use the component directly with custom props:
GitHub Clone
Where developers collaborate
Repositories
Host and manage your code repositories with version control.
Installation & Setupβ
1. Component Filesβ
Create these files in your Docusaurus project:
src/
βββ components/
βββ WebBrowser.js # Main browser component
βββ WebBrowser.module.css # Browser styles
βββ BrowserExamples.js # Example components (optional)
2. Usage in MDXβ
import WebBrowser from '@site/src/components/BrowserWindow/WebBrowser';
import { BasicBrowser, InteractiveBrowser } from '@site/src/components/BrowserWindow/BrowserExamples';
<WebBrowser url="https://example.com" height="500px" />
<BasicBrowser />
<InteractiveBrowser />
3. Props Referenceβ
| Prop | Type | Default | Description |
|---|---|---|---|
url | String | "https://example.com" | Initial URL to display |
title | String | "Web Browser" | Browser window title |
height | String | "600px" | Browser height |
showNavigation | Boolean | true | Show navigation buttons |
showAddressBar | Boolean | true | Show address bar |
interactive | Boolean | false | Enable navigation controls |
content | React Element | null | Custom React content |
mockData | Object | null | Mock website data |
4. Mock Data Structureβ
const mockData = {
title: "Page Title",
subtitle: "Page subtitle",
sections: [
{
title: "Section Title",
content: "Section content...",
},
],
};
Use Casesβ
- Documentation: Show website examples and previews
- Tutorials: Demonstrate web applications step-by-step
- Design Systems: Display component galleries and style guides
- API Docs: Show endpoint responses and UI examples
- Mobile Examples: Demonstrate responsive designs
Featuresβ
β
Realistic Browser UI - Complete with window controls and navigation
β
Interactive Navigation - Working back/forward/refresh buttons
β
Custom Content Support - Display React components or mock data
β
Responsive Design - Works on desktop and mobile
β
Theme Support - Adapts to light/dark themes
β
Iframe Support - Display external websites
β
Loading States - Animated loading indicators
β
Keyboard Navigation - Address bar with enter key support
Security Noteβ
When using iframe mode with external URLs, the component includes sandbox attributes for security. Some websites may not display due to X-Frame-Options headers. Use mockData or content props for guaranteed display.