Device Mockup
Showcase content within the frame of devices
Use the DeviceMockup
component to display content in a mobile or desktop mockup. They help users visualize how content or designs will appear on actual devices, improving context and clarity.
The DeviceMockup
block creates only the styled container of the device, you can use images and other elements to create your mockups. A common pattern is to use a single img
tag only that has all your mock details. You can use the AspectRatio
component to constrain the dimensions of your images.
Desktop
To turn your mobile device mockups into desktop mockups, you can set the type
prop on the component to desktop
:
You can further customize your mockup using the following five props:
showButtons
: A flag to show/hide buttons in the top-left corner of the mockup. This is enabled by default.url
: A url or text that is displayed next to the buttons.closeButtonColor
: Set to customize the color of the first button.maximizeButtonColor
: Set to customize the color of the second button.minimizeButtonColor
: Set to customize the color of the third button.
webcoreui.dev
webcoreui.dev
webcoreui.dev
API
Prop | Applicable type | Purpose |
---|---|---|
type | - | Set to "desktop" to change the style of your mockup. |
url | desktop | Sets a url or an arbitrary text for the address bar. |
showButtons | desktop | Shows action buttons on the top-left corner of the mockup. Defaults to true . |
closeButtonColor | desktop | Sets the color of the close button |
maximizeButtonColor | desktop | Sets the color of the maximize button |
minimizeButtonColor | desktop | Sets the color of the minimize button |
className | - | Pass additional CSS classes for your DeviceMockup component. |