Skip to content

UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.

feat: add iphone mockup and more demos with images

Dillion Verma05cf4ce133ba
diff --git a/config/docs.ts b/config/docs.ts
index be249d3f..1edb0ac4 100644
--- a/config/docs.ts
+++ b/config/docs.ts
@@ -179,6 +179,12 @@ export const docsConfig: DocsConfig = {
items: [],
label: "New",
},
+ {
+ title: "iPhone 15 Pro",
+ href: `/docs/components/iphone-15-pro`,
+ items: [],
+ label: "New",
+ },
],
},
{
diff --git a/content/docs/components/iphone-15-pro.mdx b/content/docs/components/iphone-15-pro.mdx
new file mode 100644
index 00000000..0df3cf52
--- /dev/null
+++ b/content/docs/components/iphone-15-pro.mdx
@@ -0,0 +1,57 @@
+---
+title: iPhone 15 Pro Mock
+date: 2024-09-01
+description: A mockup of the iPhone 15 Pro
+author: dillionverma
+published: true
+---
+
+<ComponentPreview name="iphone-15-pro-demo" />
+
+## Installation
+
+<Tabs defaultValue="cli">
+
+<TabsList>
+ <TabsTrigger value="cli">CLI</TabsTrigger>
+ <TabsTrigger value="manual">Manual</TabsTrigger>
+</TabsList>
+<TabsContent value="cli">
+
+```bash
+npx magicui-cli add iphone-15-pro
+```
+
+</TabsContent>
+
+<TabsContent value="manual">
+
+<Steps>
+
+<Step>Copy and paste the following code into your project.</Step>
+
+<ComponentSource name="iphone-15-pro" />
+
+<Step>Update the import paths to match your project setup.</Step>
+
+</Steps>
+
+</TabsContent>
+
+</Tabs>
+
+## Examples
+
+### With Image
+
+<ComponentPreview name="iphone-15-pro-demo-2" />
+
+## Props
+
+| Prop | Type | Description | Default |
+| ------ | ------ | -------------------------------------- | ------- |
+| width | number | The width of the iPhone 15 Pro window | 433 |
+| height | number | The height of the iPhone 15 Pro window | 882 |
+| src | string | The source of the image to display | |
+
+The `Iphone15Pro` component also accepts all properties of the `SVGElement` type.
diff --git a/content/docs/components/safari.mdx b/content/docs/components/safari.mdx
index 3711e5ab..9f74c8c7 100644
--- a/content/docs/components/safari.mdx
+++ b/content/docs/components/safari.mdx
@@ -1,7 +1,7 @@
---
title: Safari Mock
date: 2024-09-01
-description: A Safari mockup for your website.
+description: A safari browser mockup to showcase your website.
author: dillionverma
published: true
---
@@ -40,6 +40,12 @@ npx magicui-cli add safari
</Tabs>
+## Examples
+
+### With Image
+
+<ComponentPreview name="safari-demo-2" />
+
## Props
| Prop | Type | Description | Default |
diff --git a/registry/components/example/iphone-15-pro-demo-2.tsx b/registry/components/example/iphone-15-pro-demo-2.tsx
new file mode 100644
index 00000000..aa4839d0
--- /dev/null
+++ b/registry/components/example/iphone-15-pro-demo-2.tsx
@@ -0,0 +1,12 @@
+import Iphone15Pro from "@/registry/components/magicui/iphone-15-pro";
+
+export default function Iphone15ProDemo() {
+ return (
+ <div className="relative">
+ <Iphone15Pro
+ className="size-full"
+ src="https://via.placeholder.com/430x880"
+ />
+ </div>
+ );
+}
diff --git a/registry/components/example/iphone-15-pro-demo.tsx b/registry/components/example/iphone-15-pro-demo.tsx
new file mode 100644
index 00000000..624dc510
--- /dev/null
+++ b/registry/components/example/iphone-15-pro-demo.tsx
@@ -0,0 +1,9 @@
+import Iphone15Pro from "@/registry/components/magicui/iphone-15-pro";
+
+export default function Iphone15ProDemo() {
+ return (
+ <div className="relative">
+ <Iphone15Pro className="size-full" />
+ </div>
+ );
+}
diff --git a/registry/components/example/safari-demo-2.tsx b/registry/components/example/safari-demo-2.tsx
new file mode 100644
index 00000000..b58281b8
--- /dev/null
+++ b/registry/components/example/safari-demo-2.tsx
@@ -0,0 +1,13 @@
+import Safari from "@/registry/components/magicui/safari";
+
+export default function SafariDemo() {
+ return (
+ <div className="relative">
+ <Safari
+ url="magicui.design"
+ className="size-full"
+ src="https://via.placeholder.com/1200x750"
+ />
+ </div>
+ );
+}
diff --git a/registry/components/magicui/iphone-15-pro.tsx b/registry/components/magicui/iphone-15-pro.tsx
new file mode 100644
index 00000000..a16aef00
--- /dev/null
+++ b/registry/components/magicui/iphone-15-pro.tsx
@@ -0,0 +1,95 @@
+import { SVGProps } from "react";
+
+export interface Iphone15ProProps extends SVGProps<SVGSVGElement> {
+ width?: number;
+ height?: number;
+ src?: string;
+}
+
+export default function Iphone15Pro({
+ width = 433,
+ height = 882,
+ src,
+ ...props
+}: Iphone15ProProps) {
+ return (
+ <svg
+ width={width}
+ height={height}
+ viewBox={`0 0 ${width} ${height}`}
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ >
+ <path
+ d="M2 73C2 32.6832 34.6832 0 75 0H357C397.317 0 430 32.6832 430 73V809C430 849.317 397.317 882 357 882H75C34.6832 882 2 849.317 2 809V73Z"
+ className="fill-[#E5E5E5] dark:fill-[#404040]"
+ />
+ <path
+ d="M0 171C0 170.448 0.447715 170 1 170H3V204H1C0.447715 204 0 203.552 0 203V171Z"
+ className="fill-[#E5E5E5] dark:fill-[#404040]"
+ />
+ <path
+ d="M1 234C1 233.448 1.44772 233 2 233H3.5V300H2C1.44772 300 1 299.552 1 299V234Z"
+ className="fill-[#E5E5E5] dark:fill-[#404040]"
+ />
+ <path
+ d="M1 319C1 318.448 1.44772 318 2 318H3.5V385H2C1.44772 385 1 384.552 1 384V319Z"
+ className="fill-[#E5E5E5] dark:fill-[#404040]"
+ />
+ <path
+ d="M430 279H432C432.552 279 433 279.448 433 280V384C433 384.552 432.552 385 432 385H430V279Z"
+ className="fill-[#E5E5E5] dark:fill-[#404040]"
+ />
+ <path
+ d="M6 74C6 35.3401 37.3401 4 76 4H356C394.66 4 426 35.3401 426 74V808C426 846.66 394.66 878 356 878H76C37.3401 878 6 846.66 6 808V74Z"
+ className="dark:fill-[#262626] fill-white"
+ />
+ <path
+ opacity="0.5"
+ d="M174 5H258V5.5C258 6.60457 257.105 7.5 256 7.5H176C174.895 7.5 174 6.60457 174 5.5V5Z"
+ className="fill-[#E5E5E5] dark:fill-[#404040]"
+ />
+ <path
+ d="M21.25 75C21.25 44.2101 46.2101 19.25 77 19.25H355C385.79 19.25 410.75 44.2101 410.75 75V807C410.75 837.79 385.79 862.75 355 862.75H77C46.2101 862.75 21.25 837.79 21.25 807V75Z"
+ className="fill-[#E5E5E5] dark:fill-[#404040] stroke-[#E5E5E5] dark:stroke-[#404040] stroke-[0.5]"
+ />
+
+ {src && (
+ <image
+ href={src}
+ x="21.25"
+ y="19.25"
+ width="389.5"
+ height="843.5"
+ preserveAspectRatio="xMidYMid slice"
+ clipPath="url(#roundedCorners)"
+ />
+ )}
+ <path
+ d="M154 48.5C154 38.2827 162.283 30 172.5 30H259.5C269.717 30 278 38.2827 278 48.5C278 58.7173 269.717 67 259.5 67H172.5C162.283 67 154 58.7173 154 48.5Z"
+ className="dark:fill-[#262626] fill-[#F5F5F5]"
+ />
+ <path
+ d="M249 48.5C249 42.701 253.701 38 259.5 38C265.299 38 270 42.701 270 48.5C270 54.299 265.299 59 259.5 59C253.701 59 249 54.299 249 48.5Z"
+ className="dark:fill-[#262626] fill-[#F5F5F5]"
+ />
+ <path
+ d="M254 48.5C254 45.4624 256.462 43 259.5 43C262.538 43 265 45.4624 265 48.5C265 51.5376 262.538 54 259.5 54C256.462 54 254 51.5376 254 48.5Z"
+ className="fill-[#E5E5E5] dark:fill-[#404040]"
+ />
+ <defs>
+ <clipPath id="roundedCorners">
+ <rect
+ x="21.25"
+ y="19.25"
+ width="389.5"
+ height="843.5"
+ rx="55.75"
+ ry="55.75"
+ />
+ </clipPath>
+ </defs>
+ </svg>
+ );
+}
diff --git a/registry/components/magicui/safari.tsx b/registry/components/magicui/safari.tsx
index 9558ea5d..0d17e936 100644
--- a/registry/components/magicui/safari.tsx
+++ b/registry/components/magicui/safari.tsx
@@ -12,7 +12,6 @@ export default function Safari({
url,
width = 1203,
height = 753,
-
...props
}: SafariProps) {
return (
diff --git a/registry/index.tsx b/registry/index.tsx
index e1033f11..ab6aa1ac 100644
--- a/registry/index.tsx
+++ b/registry/index.tsx
@@ -264,6 +264,11 @@ const ui: Registry = {
type: "components:magicui",
files: ["registry/components/magicui/safari.tsx"],
},
+ "iphone-15-pro": {
+ name: "iphone-15-pro",
+ type: "components:magicui",
+ files: ["registry/components/magicui/iphone-15-pro.tsx"],
+ },
};
const example: Registry = {
@@ -966,6 +971,30 @@ const example: Registry = {
() => import("@/registry/components/example/safari-demo"),
),
},
+ "safari-demo-2": {
+ name: "safari-demo-2",
+ type: "components:example",
+ files: ["registry/components/example/safari-demo-2.tsx"],
+ component: React.lazy(
+ () => import("@/registry/components/example/safari-demo-2"),
+ ),
+ },
+ "iphone-15-pro-demo": {
+ name: "iphone-15-pro-demo",
+ type: "components:example",
+ files: ["registry/components/example/iphone-15-pro-demo.tsx"],
+ component: React.lazy(
+ () => import("@/registry/components/example/iphone-15-pro-demo"),
+ ),
+ },
+ "iphone-15-pro-demo-2": {
+ name: "iphone-15-pro-demo-2",
+ type: "components:example",
+ files: ["registry/components/example/iphone-15-pro-demo-2.tsx"],
+ component: React.lazy(
+ () => import("@/registry/components/example/iphone-15-pro-demo-2"),
+ ),
+ },
};
export const registry: Registry = {
...ui,