Skip to content

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

Improved Accessibility for Magic UI Design (#322)

Sanjay Mali1055995799d1
diff --git a/components/component-preview.tsx b/components/component-preview.tsx
index 5fb7abf6..6d50dbf8 100644
--- a/components/component-preview.tsx
+++ b/components/component-preview.tsx
@@ -81,7 +81,7 @@ export function ComponentPreview({
className="absolute right-0 top-0 z-10 ml-4 flex items-center rounded-lg px-3 py-1"
variant="ghost"
>
- <RotateCcw size={16} />
+ <RotateCcw aria-label="restart-btn" size={16} />
</Button>
<React.Suspense
fallback={
diff --git a/components/main-nav.tsx b/components/main-nav.tsx
index 0f1d906c..7cbac9db 100644
--- a/components/main-nav.tsx
+++ b/components/main-nav.tsx
@@ -28,6 +28,7 @@ export function MainNav() {
<Link
key={item.href}
href={item.href!}
+ aria-label={item.title}
onClick={() => item.event && posthog.capture(item.event)}
target={item.external ? "_blank" : undefined}
className={cn(
diff --git a/components/tech-stack.tsx b/components/tech-stack.tsx
index 4d052567..4d7ce693 100644
--- a/components/tech-stack.tsx
+++ b/components/tech-stack.tsx
@@ -21,6 +21,7 @@ const techComponents: TechComponents = {
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
className="size-8"
+ aria-label="Next.js"
fill="currentColor"
>
<title>Next.js</title>
@@ -35,6 +36,7 @@ const techComponents: TechComponents = {
role="img"
viewBox="0 0 32 32"
xmlns="http://www.w3.org/2000/svg"
+ aria-label="React"
className="size-8"
fill="currentColor"
>
@@ -49,6 +51,7 @@ const techComponents: TechComponents = {
<svg
viewBox="0 0 32 32"
xmlns="http://www.w3.org/2000/svg"
+ aria-label="Typescript"
className="size-8"
fill="currentColor"
>
@@ -64,6 +67,7 @@ const techComponents: TechComponents = {
role="img"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
+ aria-label="Tailwind css"
className="size-8"
fill="currentColor"
>
@@ -79,6 +83,7 @@ const techComponents: TechComponents = {
role="img"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
+ aria-label="Framer Motion"
className="size-8"
fill="none"
stroke="currentColor"
@@ -98,6 +103,7 @@ const techComponents: TechComponents = {
icon: (
<svg
xmlns="http://www.w3.org/2000/svg"
+ aria-label="shadcn"
viewBox="0 0 256 256"
className="size-8"
fill="none"
diff --git a/config/docs.ts b/config/docs.ts
index 63fe60fa..1912b131 100644
--- a/config/docs.ts
+++ b/config/docs.ts
@@ -100,15 +100,15 @@ export const docsConfig: DocsConfig = {
title: "Components",
items: [
{
- title: "Hero Video Dialog",
- href: `/docs/components/hero-video-dialog`,
+ title: "Marquee",
+ href: `/docs/components/marquee`,
items: [],
- label: "",
},
{
- title: "Marquee",
- href: `/docs/components/marquee`,
+ title: "Hero Video Dialog",
+ href: `/docs/components/hero-video-dialog`,
items: [],
+ label: "",
},
{
title: "Bento Grid",
diff --git a/registry/components/example/dock-demo.tsx b/registry/components/example/dock-demo.tsx
index 0ad25159..84529045 100644
--- a/registry/components/example/dock-demo.tsx
+++ b/registry/components/example/dock-demo.tsx
@@ -105,6 +105,7 @@ export default function DockDemo() {
<TooltipTrigger asChild>
<Link
href={item.href}
+ aria-label={item.label}
className={cn(
buttonVariants({ variant: "ghost", size: "icon" }),
"size-12 rounded-full",
@@ -126,6 +127,7 @@ export default function DockDemo() {
<TooltipTrigger asChild>
<Link
href={social.url}
+ aria-label={social.name}
className={cn(
buttonVariants({ variant: "ghost", size: "icon" }),
"size-12 rounded-full",