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 bento grid

Dillion Vermadf1cf9e6dc83
diff --git a/components/ui/calendar.tsx b/components/ui/calendar.tsx
new file mode 100644
index 00000000..6c08e3ab
--- /dev/null
+++ b/components/ui/calendar.tsx
@@ -0,0 +1,71 @@
+"use client"
+
+import * as React from "react"
+import { ChevronLeftIcon, ChevronRightIcon } from "@radix-ui/react-icons"
+import { DayPicker } from "react-day-picker"
+
+import { cn } from "@/lib/utils"
+import { buttonVariants } from "@/components/ui/button"
+
+export type CalendarProps = React.ComponentProps<typeof DayPicker>
+
+function Calendar({
+ className,
+ classNames,
+ showOutsideDays = true,
+ ...props
+}: CalendarProps) {
+ return (
+ <DayPicker
+ showOutsideDays={showOutsideDays}
+ className={cn("p-3", className)}
+ classNames={{
+ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
+ month: "space-y-4",
+ caption: "flex justify-center pt-1 relative items-center",
+ caption_label: "text-sm font-medium",
+ nav: "space-x-1 flex items-center",
+ nav_button: cn(
+ buttonVariants({ variant: "outline" }),
+ "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
+ ),
+ nav_button_previous: "absolute left-1",
+ nav_button_next: "absolute right-1",
+ table: "w-full border-collapse space-y-1",
+ head_row: "flex",
+ head_cell:
+ "text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",
+ row: "flex w-full mt-2",
+ cell: cn(
+ "relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent",
+ props.mode === "range"
+ ? "[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md"
+ : "[&:has([aria-selected])]:rounded-md"
+ ),
+ day: cn(
+ buttonVariants({ variant: "ghost" }),
+ "h-8 w-8 p-0 font-normal aria-selected:opacity-100"
+ ),
+ day_range_start: "day-range-start",
+ day_range_end: "day-range-end",
+ day_selected:
+ "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
+ day_today: "bg-accent text-accent-foreground",
+ day_outside: "text-muted-foreground opacity-50",
+ day_disabled: "text-muted-foreground opacity-50",
+ day_range_middle:
+ "aria-selected:bg-accent aria-selected:text-accent-foreground",
+ day_hidden: "invisible",
+ ...classNames,
+ }}
+ components={{
+ IconLeft: ({ ...props }) => <ChevronLeftIcon className="h-4 w-4" />,
+ IconRight: ({ ...props }) => <ChevronRightIcon className="h-4 w-4" />,
+ }}
+ {...props}
+ />
+ )
+}
+Calendar.displayName = "Calendar"
+
+export { Calendar }
diff --git a/components/ui/command.tsx b/components/ui/command.tsx
index 6397547e..6f4a5eb1 100644
--- a/components/ui/command.tsx
+++ b/components/ui/command.tsx
@@ -1,12 +1,12 @@
-"use client";
+"use client"
-import * as React from "react";
-import { DialogProps } from "@radix-ui/react-dialog";
-import { MagnifyingGlassIcon } from "@radix-ui/react-icons";
-import { Command as CommandPrimitive } from "cmdk";
+import * as React from "react"
+import { DialogProps } from "@radix-ui/react-dialog"
+import { MagnifyingGlassIcon } from "@radix-ui/react-icons"
+import { Command as CommandPrimitive } from "cmdk"
-import { cn } from "@/lib/utils";
-import { Dialog, DialogContent } from "@/components/ui/dialog";
+import { cn } from "@/lib/utils"
+import { Dialog, DialogContent } from "@/components/ui/dialog"
const Command = React.forwardRef<
React.ElementRef<typeof CommandPrimitive>,
@@ -16,12 +16,12 @@ const Command = React.forwardRef<
ref={ref}
className={cn(
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
- className,
+ className
)}
{...props}
/>
-));
-Command.displayName = CommandPrimitive.displayName;
+))
+Command.displayName = CommandPrimitive.displayName
interface CommandDialogProps extends DialogProps {}
@@ -34,8 +34,8 @@ const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
</Command>
</DialogContent>
</Dialog>
- );
-};
+ )
+}
const CommandInput = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Input>,
@@ -47,14 +47,14 @@ const CommandInput = React.forwardRef<
ref={ref}
className={cn(
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
- className,
+ className
)}
{...props}
/>
</div>
-));
+))
-CommandInput.displayName = CommandPrimitive.Input.displayName;
+CommandInput.displayName = CommandPrimitive.Input.displayName
const CommandList = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.List>,
@@ -65,9 +65,9 @@ const CommandList = React.forwardRef<
className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
{...props}
/>
-));
+))
-CommandList.displayName = CommandPrimitive.List.displayName;
+CommandList.displayName = CommandPrimitive.List.displayName
const CommandEmpty = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Empty>,
@@ -78,9 +78,9 @@ const CommandEmpty = React.forwardRef<
className="py-6 text-center text-sm"
{...props}
/>
-));
+))
-CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
+CommandEmpty.displayName = CommandPrimitive.Empty.displayName
const CommandGroup = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Group>,
@@ -90,13 +90,13 @@ const CommandGroup = React.forwardRef<
ref={ref}
className={cn(
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
- className,
+ className
)}
{...props}
/>
-));
+))
-CommandGroup.displayName = CommandPrimitive.Group.displayName;
+CommandGroup.displayName = CommandPrimitive.Group.displayName
const CommandSeparator = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Separator>,
@@ -107,8 +107,8 @@ const CommandSeparator = React.forwardRef<
className={cn("-mx-1 h-px bg-border", className)}
{...props}
/>
-));
-CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
+))
+CommandSeparator.displayName = CommandPrimitive.Separator.displayName
const CommandItem = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Item>,
@@ -118,13 +118,13 @@ const CommandItem = React.forwardRef<
ref={ref}
className={cn(
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
- className,
+ className
)}
{...props}
/>
-));
+))
-CommandItem.displayName = CommandPrimitive.Item.displayName;
+CommandItem.displayName = CommandPrimitive.Item.displayName
const CommandShortcut = ({
className,
@@ -134,13 +134,13 @@ const CommandShortcut = ({
<span
className={cn(
"ml-auto text-xs tracking-widest text-muted-foreground",
- className,
+ className
)}
{...props}
/>
- );
-};
-CommandShortcut.displayName = "CommandShortcut";
+ )
+}
+CommandShortcut.displayName = "CommandShortcut"
export {
Command,
@@ -152,4 +152,4 @@ export {
CommandItem,
CommandShortcut,
CommandSeparator,
-};
+}
diff --git a/content/components/bento-grid.mdx b/content/components/bento-grid.mdx
new file mode 100644
index 00000000..244d8298
--- /dev/null
+++ b/content/components/bento-grid.mdx
@@ -0,0 +1,57 @@
+---
+title: Bento Grid
+date: 2023-11-09
+summary: Bento grid is a layout used to showcase the features of a product in a simple and elegant way.
+author: dillionverma
+published: true
+toc: false
+video: https://cdn.magicuikit.com/bento-grid.mp4
+---
+
+<ComponentPreview name="bento-demo" />
+
+<Steps>
+
+<Step>
+
+## Prerequisites
+
+```bash
+npm install -D tailwindcss clsx tailwind-merge
+npm install @radix-ui/react-icons
+npx shadcn-ui@latest add button calendar command
+```
+
+Copy and paste the following code into your project.
+
+```typescript
+// lib/utils.ts
+import clsx, { ClassValue } from "clsx";
+import { twMerge } from "tailwind-merge";
+
+export function cn(...inputs: ClassValue[]) {
+ return twMerge(clsx(inputs));
+}
+```
+
+</Step>
+
+<Step>
+
+## Installation
+
+Copy and paste the following code into your project.
+
+```text
+components/magicui/bento-grid.tsx
+```
+
+<ComponentSource name="bento-grid" />
+
+</Step>
+
+</Steps>
+
+## Examples
+
+<ComponentPreview name="bento-demo-vertical" />
diff --git a/content/components/bento.mdx b/content/components/bento.mdx
deleted file mode 100644
index 34a9d915..00000000
--- a/content/components/bento.mdx
+++ /dev/null
@@ -1,45 +0,0 @@
----
-title: Bento
-date: 2023-11-01
-summary: Bento is a grid layout used to showcase features of a product in a simple and elegant way.
-author: dillionverma
-published: false
-toc: false
-video: https://cdn.magicuikit.com/bento.mp4
----
-
-<ComponentPreview name="bento-demo" />
-
-<Steps>
-
-<Step>
-
-## Installation
-
-Copy and paste the following code into your project.
-
-```typescript
-// lib/utils.ts
-import clsx, { ClassValue } from "clsx";
-import { twMerge } from "tailwind-merge";
-
-export function cn(...inputs: ClassValue[]) {
- return twMerge(clsx(inputs));
-}
-```
-
-```text
-components/magicui/bento.tsx
-```
-
-</Step>
-
-</Steps>
-
-## Examples
-
-<ComponentPreview name="bento-demo-vertical" />
-
-### Linear Gradient
-
-## Props
diff --git a/lib/rehype-component.ts b/lib/rehype-component.ts
index 22c0faf4..bc1d5e48 100644
--- a/lib/rehype-component.ts
+++ b/lib/rehype-component.ts
@@ -85,8 +85,8 @@ export function rehypeComponent() {
const filePath = path.join(process.cwd(), src);
let source = fs.readFileSync(filePath, "utf8");
- console.log("name ", name);
- console.log("source ", source);
+ // console.log("name ", name);
+ // console.log("source ", source);
// Replace imports.
// TODO: Use @swc/core and a visitor to replace this.
diff --git a/package.json b/package.json
index f6ed0c94..f7a4f8ff 100644
--- a/package.json
+++ b/package.json
@@ -66,17 +66,18 @@
"date-fns": "^2.30.0",
"dotenv": "^16.3.1",
"eslint": "8.43.0",
- "eslint-config-next": "14.0.1",
+ "eslint-config-next": "14.0.2",
"framer-motion": "^10.12.16",
"gray-matter": "^4.0.3",
"lucide-react": "^0.274.0",
- "next": "14.0.1",
+ "next": "14.0.2",
"next-auth": "^4.24.4",
"next-contentlayer": "^0.3.4",
"next-themes": "^0.2.1",
"nodemailer": "^6.9.3",
"postcss": "8.4.24",
"react": "18.2.0",
+ "react-day-picker": "^8.9.1",
"react-dom": "18.2.0",
"react-email": "1.9.4",
"react-hook-form": "^7.45.0",
diff --git a/registry/components/example/bento-demo-vertical.tsx b/registry/components/example/bento-demo-vertical.tsx
index dddf665c..d95efab2 100644
--- a/registry/components/example/bento-demo-vertical.tsx
+++ b/registry/components/example/bento-demo-vertical.tsx
@@ -1,95 +1,62 @@
-import { Button } from "@/components/ui/button";
-import { cn } from "@/lib/utils";
-import { ChevronRight } from "lucide-react";
+import { BentoCard, BentoGrid } from "@/registry/components/magicui/bento-grid";
+import {
+ BellIcon,
+ CalendarIcon,
+ FileTextIcon,
+ GlobeIcon,
+ InputIcon,
+} from "@radix-ui/react-icons";
const features = [
{
- name: "1. Graph view",
- description:
- "Visualize relationships between items in your library to find connections.",
- image:
- "https://assets.vercel.com/image/upload/v1675318695/nextjs/showcase/loom-illustration.svg",
+ Icon: FileTextIcon,
+ name: "Save your files",
+ description: "We automatically save your files as you type.",
span: "row-start-1 row-end-4 col-start-2 col-end-3",
href: "/",
+ background: <img className="absolute -right-20 -top-20 opacity-60" />,
},
{
- name: "2. Graph view",
- description:
- "Visualize relationships between items in your library to find connections.",
- image:
- "https://assets.vercel.com/image/upload/v1675318695/nextjs/showcase/loom-illustration.svg",
+ Icon: InputIcon,
+ name: "Full text search",
+ description: "Search through all your files in one place.",
span: "col-start-1 col-end-2 row-start-1 row-end-3",
href: "/",
+ background: <img className="absolute -right-20 -top-20 opacity-60" />,
},
{
- name: "3. Graph view",
- description:
- "Visualize relationships between items in your library to find connections.",
- image:
- "https://assets.vercel.com/image/upload/v1675318695/nextjs/showcase/loom-illustration.svg",
+ Icon: GlobeIcon,
+ name: "Multilingual",
+ description: "Supports 100+ languages and counting.",
span: "col-start-1 col-end-2 row-start-3 row-end-4",
href: "/",
+ background: <img className="absolute -right-20 -top-20 opacity-60" />,
},
{
- name: "4. Graph view",
- description:
- "Visualize relationships between items in your library to find connections.",
- image:
- "https://assets.vercel.com/image/upload/v1675318695/nextjs/showcase/loom-illustration.svg",
+ Icon: CalendarIcon,
+ name: "Calendar",
+ description: "Use the calendar to filter your files by date.",
span: "col-start-3 col-end-3 row-start-1 row-end-2",
href: "/",
+ background: <img className="absolute -right-20 -top-20 opacity-60" />,
},
{
- name: "5. Graph view",
+ Icon: BellIcon,
+ name: "Notifications",
description:
- "Visualize relationships between items in your library to find connections.",
- image:
- "https://assets.vercel.com/image/upload/v1675318695/nextjs/showcase/loom-illustration.svg",
+ "Get notified when someone shares a file or mentions you in a comment.",
span: "col-start-3 col-end-3 row-start-2 row-end-4",
href: "/",
+ background: <img className="absolute -right-20 -top-20 opacity-60" />,
},
];
export default async function BentoDemo() {
return (
- <div className="grid grid-cols-3 grid-rows-3 gap-4">
+ <BentoGrid className="grid-rows-3">
{features.map((feature) => (
- <div
- key={feature.name}
- className={cn(
- "group relative col-span-1 flex flex-col justify-between overflow-hidden rounded-xl bg-white [box-shadow:0_0_0_1px_rgba(0,0,0,.03),0_2px_4px_rgba(0,0,0,.05),0_12px_24px_rgba(0,0,0,.05)] dark:bg-neutral-900",
- feature.span,
- )}
- >
- <div>
- <img
- className="absolute -right-20 -top-20 opacity-60"
- src={feature.image}
- />
- </div>
- <div className="p-6 transition-all duration-300 group-hover:-translate-y-10">
- <h3 className="mb-1 text-base font-medium text-neutral-700 dark:text-neutral-300">
- {feature.name}
- </h3>
- <p className="max-w-lg text-neutral-400">{feature.description}</p>
- </div>
- <div
- className={cn(
- "flex flex-row items-center justify-center transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100",
- "translate-y-10 opacity-0",
- "absolute bottom-4 w-full",
- )}
- >
- <Button variant="ghost" size="sm" asChild>
- <a href={feature.href}>
- Learn more
- <ChevronRight className="h-4 w-4" />
- </a>
- </Button>
- </div>
- <div className="pointer-events-none absolute inset-0 transition-all duration-300 group-hover:bg-black/[.03] group-hover:dark:bg-neutral-800/10" />
- </div>
+ <BentoCard key={feature.name} {...feature} />
))}
- </div>
+ </BentoGrid>
);
}
diff --git a/registry/components/example/bento-demo.tsx b/registry/components/example/bento-demo.tsx
index 60a4caa8..6451e7ee 100644
--- a/registry/components/example/bento-demo.tsx
+++ b/registry/components/example/bento-demo.tsx
@@ -1,91 +1,136 @@
-import { Button } from "@/components/ui/button";
+import { Calendar } from "@/components/ui/calendar";
+import {
+ Command,
+ CommandEmpty,
+ CommandGroup,
+ CommandInput,
+ CommandItem,
+ CommandList,
+} from "@/components/ui/command";
import { cn } from "@/lib/utils";
-import { ChevronRight } from "lucide-react";
+import { BentoCard, BentoGrid } from "@/registry/components/magicui/bento-grid";
+import Globe from "@/registry/components/magicui/globe";
+import Marquee from "@/registry/components/magicui/marquee";
+import {
+ CalendarIcon,
+ FileTextIcon,
+ GlobeIcon,
+ InputIcon,
+} from "@radix-ui/react-icons";
+
+const files = [
+ {
+ name: "bitcoin.pdf",
+ body: "Bitcoin is a cryptocurrency invented in 2008 by an unknown person or group of people using the name Satoshi Nakamoto.",
+ },
+ {
+ name: "finances.xlsx",
+ body: "A spreadsheet or worksheet is a file made of rows and columns that help sort data, arrange data easily, and calculate numerical data.",
+ },
+ {
+ name: "logo.svg",
+ body: "Scalable Vector Graphics is an Extensible Markup Language-based vector image format for two-dimensional graphics with support for interactivity and animation.",
+ },
+ {
+ name: "keys.gpg",
+ body: "GPG keys are used to encrypt and decrypt email, files, directories, and whole disk partitions and to authenticate messages.",
+ },
+ {
+ name: "seed.txt",
+ body: "A seed phrase, seed recovery phrase or backup seed phrase is a list of words which store all the information needed to recover Bitcoin funds on-chain.",
+ },
+];
const features = [
{
- name: "Graph view",
- description:
- "Visualize relationships between items in your library to find connections.",
- image:
- "https://assets.vercel.com/image/upload/v1675318695/nextjs/showcase/loom-illustration.svg",
- span: 1,
+ Icon: FileTextIcon,
+ name: "Save your files",
+ description: "We automatically save your files as you type.",
+ span: "col-span-3 lg:col-span-1",
href: "/",
+ background: (
+ <Marquee
+ pauseOnHover
+ className="absolute top-10 [--duration:20s] [mask-image:linear-gradient(to_top,transparent_40%,#000_100%)] "
+ >
+ {files.map((f, idx) => (
+ <figure
+ key={idx}
+ className={cn(
+ "relative w-32 cursor-pointer overflow-hidden rounded-xl border p-4",
+ "border-gray-950/[.1] bg-gray-950/[.01] hover:bg-gray-950/[.05]",
+ "dark:border-gray-50/[.1] dark:bg-gray-50/[.10] dark:hover:bg-gray-50/[.15]",
+ "blur-[1px] transition-all duration-300 ease-out hover:blur-none",
+ )}
+ >
+ <div className="flex flex-row items-center gap-2">
+ <div className="flex flex-col">
+ <figcaption className="text-sm font-medium dark:text-white ">
+ {f.name}
+ </figcaption>
+ </div>
+ </div>
+ <blockquote className="mt-2 text-xs">{f.body}</blockquote>
+ </figure>
+ ))}
+ </Marquee>
+ ),
},
{
- name: "Graph view",
- description:
- "Visualize relationships between items in your library to find connections.",
- image:
- "https://assets.vercel.com/image/upload/v1675318695/nextjs/showcase/loom-illustration.svg",
- span: 2,
+ Icon: InputIcon,
+ name: "Full text search",
+ description: "Search through all your files in one place.",
+ span: "col-span-3 lg:col-span-2",
href: "/",
+ background: (
+ <Command className="absolute right-10 top-10 w-[70%] origin-top translate-x-0 border transition-all duration-300 ease-out [mask-image:linear-gradient(to_top,transparent_40%,#000_100%)] group-hover:-translate-x-10">
+ <CommandInput placeholder="Type a command or search..." />
+ <CommandList>
+ <CommandEmpty>No results found.</CommandEmpty>
+ <CommandGroup heading="Suggestions">
+ <CommandItem>screenshot.png</CommandItem>
+ <CommandItem>bitcoin.pdf</CommandItem>
+ <CommandItem>finances.xlsx</CommandItem>
+ <CommandItem>logo.svg</CommandItem>
+ <CommandItem>keys.gpg</CommandItem>
+ <CommandItem>seed.txt</CommandItem>
+ </CommandGroup>
+ </CommandList>
+ </Command>
+ ),
},
{
- name: "Graph view",
- description:
- "Visualize relationships between items in your library to find connections.",
- image:
- "https://assets.vercel.com/image/upload/v1675318695/nextjs/showcase/loom-illustration.svg",
- span: 2,
+ Icon: GlobeIcon,
+ name: "Multilingual",
+ description: "Supports 100+ languages and counting.",
+ span: "col-span-3 lg:col-span-2",
href: "/",
+ background: (
+ <Globe className="top-0 h-[600px] w-[600px] transition-all duration-300 ease-out [mask-image:linear-gradient(to_top,transparent_30%,#000_100%)] group-hover:scale-105 sm:left-40" />
+ ),
},
{
- name: "Graph view",
- description:
- "Visualize relationships between items in your library to find connections.",
- image:
- "https://assets.vercel.com/image/upload/v1675318695/nextjs/showcase/loom-illustration.svg",
- span: 1,
+ Icon: CalendarIcon,
+ name: "Calendar",
+ description: "Use the calendar to filter your files by date.",
+ span: "col-span-3 lg:col-span-1",
href: "/",
+ background: (
+ <Calendar
+ mode="single"
+ selected={new Date(2022, 4, 11, 0, 0, 0)}
+ className="absolute right-0 top-10 origin-top rounded-md border transition-all duration-300 ease-out [mask-image:linear-gradient(to_top,transparent_40%,#000_100%)] group-hover:scale-105"
+ />
+ ),
},
];
export default async function BentoDemo() {
return (
- <div className="grid w-full auto-rows-[22rem] grid-cols-3 gap-y-4 md:gap-4">
- {features.map((feature) => (
- <div
- key={feature.name}
- className={cn(
- "group relative col-span-3 flex flex-col justify-between overflow-hidden rounded-xl bg-white [box-shadow:0_0_0_1px_rgba(0,0,0,.03),0_2px_4px_rgba(0,0,0,.05),0_12px_24px_rgba(0,0,0,.05)] dark:bg-neutral-900 ",
- {
- "lg:col-span-1": feature.span === 1,
- "lg:col-span-2": feature.span === 2,
- },
- )}
- >
- <div>
- <img
- className="absolute -right-20 -top-20 opacity-60"
- src={feature.image}
- />
- </div>
- <div className="p-6 transition-all duration-300 group-hover:-translate-y-10">
- <h3 className="mb-1 text-base font-medium text-neutral-700 dark:text-neutral-300">
- {feature.name}
- </h3>
-
- <p className="max-w-lg text-neutral-400">{feature.description}</p>
- </div>
-
- <div
- className={cn(
- "flex flex-row items-center justify-center transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100",
- "translate-y-10 opacity-0",
- "absolute bottom-4 w-full",
- )}
- >
- <Button variant="ghost" size="sm" asChild>
- <a href={feature.href}>
- Learn more
- <ChevronRight className="h-4 w-4" />
- </a>
- </Button>
- </div>
- <div className="pointer-events-none absolute inset-0 transition-all duration-300 group-hover:bg-black/[.03] group-hover:dark:bg-neutral-800/10" />
- </div>
+ <BentoGrid>
+ {features.map((feature, idx) => (
+ <BentoCard key={idx} {...feature} />
))}
- </div>
+ </BentoGrid>
);
}
diff --git a/registry/components/magicui/bento-grid.tsx b/registry/components/magicui/bento-grid.tsx
new file mode 100644
index 00000000..88f9d9f7
--- /dev/null
+++ b/registry/components/magicui/bento-grid.tsx
@@ -0,0 +1,74 @@
+import { Button } from "@/components/ui/button";
+import { cn } from "@/lib/utils";
+import { ArrowRightIcon } from "@radix-ui/react-icons";
+import { ReactNode } from "react";
+
+const BentoGrid = ({
+ children,
+ className,
+}: {
+ children: ReactNode;
+ className?: string;
+}) => {
+ return (
+ <div
+ className={cn(
+ "grid w-full auto-rows-[22rem] grid-cols-3 gap-4",
+ className,
+ )}
+ >
+ {children}
+ </div>
+ );
+};
+
+const BentoCard = ({
+ name,
+ span,
+ background,
+ Icon,
+ description,
+ href,
+}: {
+ name: string;
+ span: string;
+ background: ReactNode;
+ Icon: any;
+ description: string;
+ href: string;
+}) => (
+ <div
+ key={name}
+ className={cn(
+ "group relative flex flex-col justify-between overflow-hidden rounded-xl bg-white [box-shadow:0_0_0_1px_rgba(0,0,0,.03),0_2px_4px_rgba(0,0,0,.05),0_12px_24px_rgba(0,0,0,.05)] dark:bg-neutral-900",
+ span,
+ )}
+ >
+ <div>{background}</div>
+ <div className="pointer-events-none z-10 flex flex-col gap-1 p-6 transition-all duration-300 group-hover:-translate-y-10">
+ <Icon className="h-12 w-12 text-neutral-700 transition-all duration-300 ease-in-out group-hover:h-9 group-hover:w-9" />
+ <h3 className="text-xl font-semibold text-neutral-700 dark:text-neutral-300">
+ {name}
+ </h3>
+ <p className="max-w-lg text-neutral-400">{description}</p>
+ </div>
+
+ <div
+ className={cn(
+ "pointer-events-none flex flex-row items-center p-4 transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100",
+ "translate-y-10 opacity-0",
+ "absolute bottom-0 w-full",
+ )}
+ >
+ <Button variant="ghost" asChild size="sm" className="pointer-events-auto">
+ <a href={href}>
+ Learn more
+ <ArrowRightIcon className="ml-2 h-4 w-4" />
+ </a>
+ </Button>
+ </div>
+ <div className="pointer-events-none absolute inset-0 transition-all duration-300 group-hover:bg-black/[.03] group-hover:dark:bg-neutral-800/10" />
+ </div>
+);
+
+export { BentoCard, BentoGrid };
diff --git a/registry/index.tsx b/registry/index.tsx
index 5a6ede52..43562c6f 100644
--- a/registry/index.tsx
+++ b/registry/index.tsx
@@ -58,10 +58,15 @@ const ui: Registry = {
files: ["registry/components/magicui/tweet-card.tsx"],
},
"client-tweet-card": {
- name: "tweet-card",
+ name: "client-tweet-card",
type: "components:ui",
files: ["registry/components/magicui/client-tweet-card.tsx"],
},
+ "bento-grid": {
+ name: "bento-grid",
+ type: "components:ui",
+ files: ["registry/components/magicui/bento-grid.tsx"],
+ },
};
const example: Registry = {
diff --git a/yarn.lock b/yarn.lock
index e1eae6e6..003bacc5 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -635,62 +635,62 @@
resolved "https://registry.yarnpkg.com/@next-auth/prisma-adapter/-/prisma-adapter-1.0.7.tgz#86195e9cc5a23a9e71370c7e8745b630388143b1"
integrity sha512-Cdko4KfcmKjsyHFrWwZ//lfLUbcLqlyFqjd/nYE2m3aZ7tjMNUjpks47iw7NTCnXf+5UWz5Ypyt1dSs1EP5QJw==
- version "14.0.1"
- resolved "https://registry.yarnpkg.com/@next/env/-/env-14.0.1.tgz#7d03c9042c205a320aef2ea3f83c2d16b6825563"
- integrity sha512-Ms8ZswqY65/YfcjrlcIwMPD7Rg/dVjdLapMcSHG26W6O67EJDF435ShW4H4LXi1xKO1oRc97tLXUpx8jpLe86A==
+ version "14.0.2"
+ resolved "https://registry.yarnpkg.com/@next/env/-/env-14.0.2.tgz#c1fb535983bca768e7eccd7b9cf4636127fc6d25"
+ integrity sha512-HAW1sljizEaduEOes/m84oUqeIDAUYBR1CDwu2tobNlNDFP3cSm9d6QsOsGeNlIppU1p/p1+bWbYCbvwjFiceA==
- version "14.0.1"
- resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-14.0.1.tgz#6e587b76588a02d77267945b5d1f059a6c8fd9ca"
- integrity sha512-bLjJMwXdzvhnQOnxvHoTTUh/+PYk6FF/DCgHi4BXwXCINer+o1ZYfL9aVeezj/oI7wqGJOqwGIXrlBvPbAId3w==
+ version "14.0.2"
+ resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-14.0.2.tgz#421799f46116d8032f1739ce5ce89822453c8f03"
+ integrity sha512-APrYFsXfAhnysycqxHcpg6Y4i7Ukp30GzVSZQRKT3OczbzkqGjt33vNhScmgoOXYBU1CfkwgtXmNxdiwv1jKmg==
dependencies:
glob "7.1.7"
- version "14.0.1"
- resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.1.tgz#75a5f872c4077ecd536d7496bc24f3d312d5dcd0"
- integrity sha512-JyxnGCS4qT67hdOKQ0CkgFTp+PXub5W1wsGvIq98TNbF3YEIN7iDekYhYsZzc8Ov0pWEsghQt+tANdidITCLaw==
-
- version "14.0.1"
- resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.1.tgz#7d8498fc680cc8b4d5181bee336818c63779bc5e"
- integrity sha512-625Z7bb5AyIzswF9hvfZWa+HTwFZw+Jn3lOBNZB87lUS0iuCYDHqk3ujuHCkiyPtSC0xFBtYDLcrZ11mF/ap3w==
-
- version "14.0.1"
- resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.1.tgz#184286794e67bed192de7dbb10d7f040c996f965"
- integrity sha512-iVpn3KG3DprFXzVHM09kvb//4CNNXBQ9NB/pTm8LO+vnnnaObnzFdS5KM+w1okwa32xH0g8EvZIhoB3fI3mS1g==
-
- version "14.0.1"
- resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.1.tgz#e8121b860ebc97a8d2a9113e5a42878430e749d5"
- integrity sha512-mVsGyMxTLWZXyD5sen6kGOTYVOO67lZjLApIj/JsTEEohDDt1im2nkspzfV5MvhfS7diDw6Rp/xvAQaWZTv1Ww==
-
- version "14.0.1"
- resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.1.tgz#cdc4276b11a10c892fd1cb7dd31e024064db9c3b"
- integrity sha512-wMqf90uDWN001NqCM/auRl3+qVVeKfjJdT9XW+RMIOf+rhUzadmYJu++tp2y+hUbb6GTRhT+VjQzcgg/QTD9NQ==
-
- version "14.0.1"
- resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.1.tgz#4a194a484ceb34fd370e8d1af571493859fb2542"
- integrity sha512-ol1X1e24w4j4QwdeNjfX0f+Nza25n+ymY0T2frTyalVczUmzkVD7QGgPTZMHfR1aLrO69hBs0G3QBYaj22J5GQ==
-
- version "14.0.1"
- resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.1.tgz#71923debee50f98ef166b28cdb3ad7e7463e6598"
- integrity sha512-WEmTEeWs6yRUEnUlahTgvZteh5RJc4sEjCQIodJlZZ5/VJwVP8p2L7l6VhzQhT4h7KvLx/Ed4UViBdne6zpIsw==
-
- version "14.0.1"
- resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.1.tgz#b8f46da899c279fd65db76f0951849290c480ef9"
- integrity sha512-oFpHphN4ygAgZUKjzga7SoH2VGbEJXZa/KL8bHCAwCjDWle6R1SpiGOdUdA8EJ9YsG1TYWpzY6FTbUA+iAJeww==
-
- version "14.0.1"
- resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.0.1.tgz#be3dd8b3729ec51c99ff04b51e2b235756d02b6e"
- integrity sha512-FFp3nOJ/5qSpeWT0BZQ+YE1pSMk4IMpkME/1DwKBwhg4mJLB9L+6EXuJi4JEwaJdl5iN+UUlmUD3IsR1kx5fAg==
+ version "14.0.2"
+ resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.2.tgz#eba35a1425fee5d305903c85ae0d6d2b0d512c7b"
+ integrity sha512-i+jQY0fOb8L5gvGvojWyZMfQoQtDVB2kYe7fufOEiST6sicvzI2W5/EXo4lX5bLUjapHKe+nFxuVv7BA+Pd7LQ==
+
+ version "14.0.2"
+ resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.2.tgz#8adb4dfc3d596c0816da67df9b75603218cf2a42"
+ integrity sha512-zRCAO0d2hW6gBEa4wJaLn+gY8qtIqD3gYd9NjruuN98OCI6YyelmhWVVLlREjS7RYrm9OUQIp/iVJFeB6kP1hg==
+
+ version "14.0.2"
+ resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.2.tgz#1f88d066d44c9229a861815e3d449b0037dae14e"
+ integrity sha512-tSJmiaon8YaKsVhi7GgRizZoV0N1Sx5+i+hFTrCKKQN7s3tuqW0Rov+RYdPhAv/pJl4qiG+XfSX4eJXqpNg3dA==
+
+ version "14.0.2"
+ resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.2.tgz#de9b2708abc35dd19429a662a11785d0c54d1ec7"
+ integrity sha512-dXJLMSEOwqJKcag1BeX1C+ekdPPJ9yXbWIt3nAadhbLx5CjACoB2NQj9Xcqu2tmdr5L6m34fR+fjGPs+ZVPLzA==
+
+ version "14.0.2"
+ resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.2.tgz#64bd555dcbc7fd6c38cb86028baf7d7fc80bd4ac"
+ integrity sha512-WC9KAPSowj6as76P3vf1J3mf2QTm3Wv3FBzQi7UJ+dxWjK3MhHVWsWUo24AnmHx9qDcEtHM58okgZkXVqeLB+Q==
+
+ version "14.0.2"
+ resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.2.tgz#69e6abf0f516df69acbf663eeb8ed6fd8eebcc38"
+ integrity sha512-KSSAwvUcjtdZY4zJFa2f5VNJIwuEVnOSlqYqbQIawREJA+gUI6egeiRu290pXioQXnQHYYdXmnVNZ4M+VMB7KQ==
+
+ version "14.0.2"
+ resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.2.tgz#82bc49af0986f4b2c113b5f223a559fc51b49b9d"
+ integrity sha512-2/O0F1SqJ0bD3zqNuYge0ok7OEWCQwk55RPheDYD0va5ij7kYwrFkq5ycCRN0TLjLfxSF6xI5NM6nC5ux7svEQ==
+
+ version "14.0.2"
+ resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.2.tgz#2f1958ad82b7f7ec5da8ad8ac2f18ef7a8e7757f"
+ integrity sha512-vJI/x70Id0oN4Bq/R6byBqV1/NS5Dl31zC+lowO8SDu1fHmUxoAdILZR5X/sKbiJpuvKcCrwbYgJU8FF/Gh50Q==
+
+ version "14.0.2"
+ resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.0.2.tgz#629174f587beb640a431a4a3fe4e26d5d4f8de52"
+ integrity sha512-Ut4LXIUvC5m8pHTe2j0vq/YDnTEyq6RSR9vHYPqnELrDapPhLNz9Od/L5Ow3J8RNDWpEnfCiQXuVdfjlNEJ7ug==
"@nodelib/[email protected]":
version "2.1.5"
@@ -3256,12 +3256,12 @@ escape-string-regexp@^5.0.0:
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8"
integrity sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==
- version "14.0.1"
- resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-14.0.1.tgz#4e59cbaa1c1c72f6d7c4d9110b0902630493ef56"
- integrity sha512-QfIFK2WD39H4WOespjgf6PLv9Bpsd7KGGelCtmq4l67nGvnlsGpuvj0hIT+aIy6p5gKH+lAChYILsyDlxP52yg==
+ version "14.0.2"
+ resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-14.0.2.tgz#bbcd7af62ed9700d9dd74c1b8538fdb9495d46ce"
+ integrity sha512-CasWThlsyIcg/a+clU6KVOMTieuDhTztsrqvniP6AsRki9v7FnojTa7vKQOYM8QSOsQdZ/aElLD1Y2Oc8/PsIg==
dependencies:
- "@next/eslint-plugin-next" "14.0.1"
+ "@next/eslint-plugin-next" "14.0.2"
"@rushstack/eslint-patch" "^1.3.3"
"@typescript-eslint/parser" "^5.4.2 || ^6.0.0"
eslint-import-resolver-node "^0.3.6"
@@ -5609,12 +5609,12 @@ next-themes@^0.2.1:
resolved "https://registry.yarnpkg.com/next-themes/-/next-themes-0.2.1.tgz#0c9f128e847979daf6c67f70b38e6b6567856e45"
integrity sha512-B+AKNfYNIzh0vqQQKqQItTS8evEouKD7H5Hj3kmuPERwddR2TxvDSFZuTj6T7Jfn1oyeUyJMydPl1Bkxkh0W7A==
- version "14.0.1"
- resolved "https://registry.yarnpkg.com/next/-/next-14.0.1.tgz#1375d94c5dc7af730234af48401be270e975cb22"
- integrity sha512-s4YaLpE4b0gmb3ggtmpmV+wt+lPRuGtANzojMQ2+gmBpgX9w5fTbjsy6dXByBuENsdCX5pukZH/GxdFgO62+pA==
+ version "14.0.2"
+ resolved "https://registry.yarnpkg.com/next/-/next-14.0.2.tgz#02ba6a1656edf14d3913c7a3553026e9d6e083c7"
+ integrity sha512-jsAU2CkYS40GaQYOiLl9m93RTv2DA/tTJ0NRlmZIBIL87YwQ/xR8k796z7IqgM3jydI8G25dXvyYMC9VDIevIg==
dependencies:
- "@next/env" "14.0.1"
+ "@next/env" "14.0.2"
"@swc/helpers" "0.5.2"
busboy "1.6.0"
caniuse-lite "^1.0.30001406"
@@ -5622,15 +5622,15 @@ [email protected]:
styled-jsx "5.1.1"
watchpack "2.4.0"
optionalDependencies:
- "@next/swc-darwin-arm64" "14.0.1"
- "@next/swc-darwin-x64" "14.0.1"
- "@next/swc-linux-arm64-gnu" "14.0.1"
- "@next/swc-linux-arm64-musl" "14.0.1"
- "@next/swc-linux-x64-gnu" "14.0.1"
- "@next/swc-linux-x64-musl" "14.0.1"
- "@next/swc-win32-arm64-msvc" "14.0.1"
- "@next/swc-win32-ia32-msvc" "14.0.1"
- "@next/swc-win32-x64-msvc" "14.0.1"
+ "@next/swc-darwin-arm64" "14.0.2"
+ "@next/swc-darwin-x64" "14.0.2"
+ "@next/swc-linux-arm64-gnu" "14.0.2"
+ "@next/swc-linux-arm64-musl" "14.0.2"
+ "@next/swc-linux-x64-gnu" "14.0.2"
+ "@next/swc-linux-x64-musl" "14.0.2"
+ "@next/swc-win32-arm64-msvc" "14.0.2"
+ "@next/swc-win32-ia32-msvc" "14.0.2"
+ "@next/swc-win32-x64-msvc" "14.0.2"
nice-try@^1.0.4:
version "1.0.5"
@@ -6514,6 +6514,11 @@ quick-lru@^5.1.1:
resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932"
integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==
+react-day-picker@^8.9.1:
+ version "8.9.1"
+ resolved "https://registry.yarnpkg.com/react-day-picker/-/react-day-picker-8.9.1.tgz#62dcc2bc1282ac72d057266112d9c8558334e757"
+ integrity sha512-W0SPApKIsYq+XCtfGeMYDoU0KbsG3wfkYtlw8l+vZp6KoBXGOlhzBUp4tNx1XiwiOZwhfdGOlj7NGSCKGSlg5Q==
+
version "18.2.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d"