Skip to content

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

fix: fix small bugs across landing page

Dillion Verma4ba53e9a65d4
diff --git a/components/mode-toggle.tsx b/components/mode-toggle.tsx
index 892c15f6..9621a13c 100644
--- a/components/mode-toggle.tsx
+++ b/components/mode-toggle.tsx
@@ -1,25 +1,33 @@
"use client";
+import React from "react";
import { MoonIcon, SunIcon } from "@radix-ui/react-icons";
import { useTheme } from "next-themes";
import { cn } from "@/lib/utils";
import { Button } from "@/components/ui/button";
-export function ModeToggle({ className }: { className?: string }) {
+export const ModeToggle = React.forwardRef<
+ HTMLButtonElement,
+ React.ComponentPropsWithoutRef<typeof Button> & { className?: string }
+>(({ className, ...props }, ref) => {
const { theme, setTheme } = useTheme();
return (
<Button
+ ref={ref}
variant="ghost"
type="button"
size="icon"
className={cn("px-2", className)}
- aria-label={"Toggle theme"}
+ aria-label="Toggle theme"
onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
+ {...props}
>
<SunIcon className="size-[1.2rem] text-neutral-800 dark:hidden dark:text-neutral-200" />
<MoonIcon className="hidden size-[1.2rem] text-neutral-800 dark:block dark:text-neutral-200" />
</Button>
);
-}
+});
+
+ModeToggle.displayName = "ModeToggle";
diff --git a/components/sections/showcase.tsx b/components/sections/showcase.tsx
index 7a7f52a0..8f2b0434 100644
--- a/components/sections/showcase.tsx
+++ b/components/sections/showcase.tsx
@@ -1,4 +1,3 @@
-import Image from "next/image";
import Link from "next/link";
import { allShowcases } from "@/.contentlayer/generated";
import { ChevronRightIcon } from "@radix-ui/react-icons";
@@ -22,7 +21,7 @@ export function ShowcaseCard({
href={href}
className="flex flex-col gap-2 group relative overflow-hidden cursor-pointer"
>
- <Image
+ <img
src={image}
alt={title}
width={500}
diff --git a/content/pages/home.mdx b/content/pages/home.mdx
index 0228939c..5a31801d 100644
--- a/content/pages/home.mdx
+++ b/content/pages/home.mdx
@@ -3,21 +3,21 @@ title: Components
description: A collection of components that are used to build the landing page of a website.
---
-<ComponentPreview name="bento-demo" preview />
<ComponentPreview name="marquee-demo" preview />
<ComponentPreview name="marquee-demo-vertical" preview />
-<ComponentPreview name="ripple-demo" preview />
+<ComponentPreview name="bento-demo" preview />
+<ComponentPreview name="dock-demo" preview />
<ComponentPreview name="animated-list-demo" preview />
<ComponentPreview name="animated-beam-demo" preview />
<ComponentPreview name="animated-beam-multiple-inputs" preview />
<ComponentPreview name="animated-beam-multiple-outputs" preview />
<ComponentPreview name="particles-demo" preview />
+<ComponentPreview name="border-beam-demo" preview />
<ComponentPreview name="blur-fade-demo" preview />
<ComponentPreview name="blur-fade-text-demo" preview />
<ComponentPreview name="retro-grid-demo" preview />
<ComponentPreview name="magic-card-demo" preview />
-<ComponentPreview name="border-beam-demo" preview />
<ComponentPreview name="orbiting-circles-demo" preview />
-<ComponentPreview name="dock-demo" preview />
+<ComponentPreview name="ripple-demo" preview />
<ComponentPreview name="shine-border-demo" preview />
<ComponentPreview name="confetti-demo" preview />
diff --git a/registry/components/example/animated-list-demo.tsx b/registry/components/example/animated-list-demo.tsx
index f9f34068..cb7d53f0 100644
--- a/registry/components/example/animated-list-demo.tsx
+++ b/registry/components/example/animated-list-demo.tsx
@@ -82,9 +82,18 @@ const Notification = ({ name, description, icon, color, time }: Item) => {
);
};
-export default function AnimatedListDemo() {
+export default function AnimatedListDemo({
+ className,
+}: {
+ className?: string;
+}) {
return (
- <div className="relative flex h-[500px] w-full flex-col p-6 overflow-hidden rounded-lg border bg-background md:shadow-xl">
+ <div
+ className={cn(
+ "relative flex h-[500px] w-full flex-col p-6 overflow-hidden rounded-lg border bg-background md:shadow-xl",
+ className,
+ )}
+ >
<AnimatedList>
{notifications.map((item, idx) => (
<Notification {...item} key={idx} />
diff --git a/registry/components/example/bento-demo.tsx b/registry/components/example/bento-demo.tsx
index 33318633..f4201f87 100644
--- a/registry/components/example/bento-demo.tsx
+++ b/registry/components/example/bento-demo.tsx
@@ -1,19 +1,12 @@
-import { CalendarIcon, FileTextIcon, InputIcon } from "@radix-ui/react-icons";
-import { Share2Icon } from "lucide-react";
+import { CalendarIcon, FileTextIcon } from "@radix-ui/react-icons";
+import { BellIcon, Share2Icon } from "lucide-react";
import { cn } from "@/lib/utils";
import { Calendar } from "@/components/ui/calendar";
-import {
- Command,
- CommandEmpty,
- CommandGroup,
- CommandInput,
- CommandItem,
- CommandList,
-} from "@/components/ui/command";
import AnimatedBeamMultipleOutputDemo from "@/components/example/animated-beam-multiple-outputs";
import { BentoCard, BentoGrid } from "@/components/magicui/bento-grid";
import Marquee from "@/components/magicui/marquee";
+import AnimatedListDemo from "@/registry/components/example/animated-list-demo";
const files = [
{
@@ -38,91 +31,12 @@ const files = [
},
];
-interface Item {
- name: string;
- description: string;
- icon: string;
- color: string;
- time: string;
-}
-
-let notifications = [
- {
- name: "Payment received",
- description: "Magic UI",
- time: "15m ago",
-
- icon: "💸",
- color: "#00C9A7",
- },
- {
- name: "User signed up",
- description: "Magic UI",
- time: "10m ago",
- icon: "👤",
- color: "#FFB800",
- },
- {
- name: "New message",
- description: "Magic UI",
- time: "5m ago",
- icon: "💬",
- color: "#FF3D71",
- },
- {
- name: "New event",
- description: "Magic UI",
- time: "2m ago",
- icon: "🗞️",
- color: "#1E86FF",
- },
-];
-
-notifications = Array.from({ length: 10 }, () => notifications).flat();
-
-const Notification = ({ name, description, icon, color, time }: Item) => {
- return (
- <figure
- className={cn(
- "relative mx-auto min-h-fit w-full max-w-[400px] cursor-pointer overflow-hidden rounded-2xl p-4",
- // animation styles
- "transition-all duration-200 ease-in-out hover:scale-[103%]",
- // light styles
- "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 styles
- "transform-gpu dark:bg-transparent dark:backdrop-blur-md dark:[border:1px_solid_rgba(255,255,255,.1)] dark:[box-shadow:0_-20px_80px_-20px_#ffffff1f_inset]",
- )}
- >
- <div className="flex flex-row items-center gap-3">
- <div
- className="flex size-10 items-center justify-center rounded-2xl"
- style={{
- backgroundColor: color,
- }}
- >
- <span className="text-lg">{icon}</span>
- </div>
- <div className="flex flex-col overflow-hidden">
- <figcaption className="flex flex-row items-center whitespace-pre text-lg font-medium dark:text-white ">
- <span className="text-sm sm:text-lg">{name}</span>
- <span className="mx-1">·</span>
- <span className="text-xs text-gray-500">{time}</span>
- </figcaption>
- <p className="text-sm font-normal dark:text-white/60">
- {description}
- </p>
- </div>
- </div>
- </figure>
- );
-};
-
const features = [
{
Icon: FileTextIcon,
name: "Save your files",
description: "We automatically save your files as you type.",
- href: "/",
+ href: "#",
cta: "Learn more",
className: "col-span-3 lg:col-span-1",
background: (
@@ -154,34 +68,21 @@ const features = [
),
},
{
- Icon: InputIcon,
- name: "Full text search",
- description: "Search through all your files in one place.",
- href: "/",
+ Icon: BellIcon,
+ name: "Notifications",
+ description: "Get notified when something happens.",
+ href: "#",
cta: "Learn more",
className: "col-span-3 lg:col-span-2",
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>
+ <AnimatedListDemo className="absolute right-2 top-4 h-[300px] w-[600px] border-none transition-all duration-300 ease-out [mask-image:linear-gradient(to_top,transparent_10%,#000_100%)] group-hover:scale-105" />
),
},
{
Icon: Share2Icon,
name: "Integrations",
description: "Supports 100+ integrations and counting.",
- href: "/",
+ href: "#",
cta: "Learn more",
className: "col-span-3 lg:col-span-2",
background: (
@@ -193,7 +94,7 @@ const features = [
name: "Calendar",
description: "Use the calendar to filter your files by date.",
className: "col-span-3 lg:col-span-1",
- href: "/",
+ href: "#",
cta: "Learn more",
background: (
<Calendar
diff --git a/registry/components/example/dock-demo.tsx b/registry/components/example/dock-demo.tsx
index cb56faec..82ddadf5 100644
--- a/registry/components/example/dock-demo.tsx
+++ b/registry/components/example/dock-demo.tsx
@@ -98,7 +98,7 @@ export default function DockDemo() {
</span>
<Dock direction="middle">
{DATA.navbar.map((item) => (
- <DockIcon key={item.href}>
+ <DockIcon key={item.label}>
<Tooltip>
<TooltipTrigger asChild>
<Link