Giter VIP home page Giter VIP logo

magicuidesign / magicui Goto Github PK

View Code? Open in Web Editor NEW
7.7K 15.0 296.0 11.32 MB

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

Home Page: https://magicui.design

License: MIT License

TypeScript 83.76% CSS 0.53% MDX 14.81% JavaScript 0.42% Dockerfile 0.48% Shell 0.01%
framer-motion nextjs react tailwindcss typescript components shadcn-ui

magicui's Introduction

Magic UI - UI Library for Design Engineers

Magic UI

UI Library for Design Engineers

GitHub Repo stars Twitter Follow License Discord

Documentation

Visit https://magicui.design/docs to view the documentation.

Contributing

Visit our contributing guide to learn how to contribute. It only takes ~5 minutes to add your own!

Let's talk

Book us with Cal.com

Authors

Deploy

Deploy with Vercel

Deploy on Railway

Stats

Alt

License

Licensed under the MIT license.

magicui's People

Contributors

abdrahmanes1 avatar alamenai avatar anshumanrathore-coder avatar bankkroll avatar debbl avatar dillionverma avatar doffuxx avatar draxx0 avatar gokh4nozturk avatar gursheyss avatar hydenliu avatar i-m-gaurav avatar ianduha13 avatar imanubhardwaj avatar itsarghyadas avatar joacoc avatar julian-at avatar lakshya-mogha avatar luis-codex avatar morcxlla avatar nyxb avatar pilladipesh33 avatar prakashsp23 avatar safethecode avatar skuzow avatar swayambhuprasad avatar tomonarifeehan avatar unnamed-lab avatar wellitsabhi avatar whyismynamerudy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

magicui's Issues

Issues while trying to set up the project on my local machine

I have followed the steps need and installed all the packages but I am getting this error message

⨯ Error: Cannot find package 'C:\Users\USER\Documents\Programming\open-source\magicui\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected]_qyaeezilld56lj2pad6hqnrkxu\node_modules\@opentelemetry\exporter-trace-otlp-grpc\package.json' imported from C:\Users\USER\Documents\Programming\open-source\magicui\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected]_qyaeezilld56lj2pad6hqnrkxu\node_modules\@effect-ts\otel-exporter-trace-otlp-grpc\_mjs\index.mjs
Did you mean to import "@opentelemetry/exporter-trace-otlp-grpc/build/src/index.js"?
    at legacyMainResolve (node:internal/modules/esm/resolve:215:26)        
    at packageResolve (node:internal/modules/esm/resolve:841:14)
    at moduleResolve (node:internal/modules/esm/resolve:927:18)
    at defaultResolve (node:internal/modules/esm/resolve:1157:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)      
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38) 
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39) 
    at link (node:internal/modules/esm/module_job:86:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
Error: Cannot find package 'C:\Users\USER\Documents\Programming\open-source\magicui\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected]_qyaeezilld56lj2pad6hqnrkxu\node_modules\@opentelemetry\exporter-trace-otlp-grpc\package.json' imported from C:\Users\USER\Documents\Programming\open-source\magicui\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected]_qyaeezilld56lj2pad6hqnrkxu\node_modules\@effect-ts\otel-exporter-trace-otlp-grpc\_mjs\index.mjs
Did you mean to import "@opentelemetry/exporter-trace-otlp-grpc/build/src/index.js"?
    at legacyMainResolve (node:internal/modules/esm/resolve:215:26)        
    at packageResolve (node:internal/modules/esm/resolve:841:14)
    at moduleResolve (node:internal/modules/esm/resolve:927:18)
    at defaultResolve (node:internal/modules/esm/resolve:1157:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)      
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38) 
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39) 
    at link (node:internal/modules/esm/module_job:86:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
Error: Cannot find package 'C:\Users\USER\Documents\Programming\open-source\magicui\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected]_qyaeezilld56lj2pad6hqnrkxu\node_modules\@opentelemetry\exporter-trace-otlp-grpc\package.json' imported from C:\Users\USER\Documents\Programming\open-source\magicui\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected]_qyaeezilld56lj2pad6hqnrkxu\node_modules\@effect-ts\otel-exporter-trace-otlp-grpc\_mjs\index.mjs
Did you mean to import "@opentelemetry/exporter-trace-otlp-grpc/build/src/index.js"?
    at legacyMainResolve (node:internal/modules/esm/resolve:215:26)        
    at packageResolve (node:internal/modules/esm/resolve:841:14)
    at moduleResolve (node:internal/modules/esm/resolve:927:18)
    at defaultResolve (node:internal/modules/esm/resolve:1157:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)      
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38) 
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39) 
    at link (node:internal/modules/esm/module_job:86:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
 ⨯ Error: Cannot find package 'C:\Users\USER\Documents\Programming\open-source\magicui\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected]_qyaeezilld56lj2pad6hqnrkxu\node_modules\@opentelemetry\exporter-trace-otlp-grpc\package.json' imported from C:\Users\USER\Documents\Programming\open-source\magicui\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected]_qyaeezilld56lj2pad6hqnrkxu\node_modules\@effect-ts\otel-exporter-trace-otlp-grpc\_mjs\index.mjs
Did you mean to import "@opentelemetry/exporter-trace-otlp-grpc/build/src/index.js"?
    at legacyMainResolve (node:internal/modules/esm/resolve:215:26)        
    at packageResolve (node:internal/modules/esm/resolve:841:14)
    at moduleResolve (node:internal/modules/esm/resolve:927:18)
    at defaultResolve (node:internal/modules/esm/resolve:1157:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)      
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38) 
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39) 
    at link (node:internal/modules/esm/module_job:86:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
Error: Cannot find package 'C:\Users\USER\Documents\Programming\open-source\magicui\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected]_qyaeezilld56lj2pad6hqnrkxu\node_modules\@opentelemetry\exporter-trace-otlp-grpc\package.json' imported from C:\Users\USER\Documents\Programming\open-source\magicui\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected]_qyaeezilld56lj2pad6hqnrkxu\node_modules\@effect-ts\otel-exporter-trace-otlp-grpc\_mjs\index.mjs
Did you mean to import "@opentelemetry/exporter-trace-otlp-grpc/build/src/index.js"?
    at legacyMainResolve (node:internal/modules/esm/resolve:215:26)        
    at packageResolve (node:internal/modules/esm/resolve:841:14)
    at moduleResolve (node:internal/modules/esm/resolve:927:18)
    at defaultResolve (node:internal/modules/esm/resolve:1157:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)      
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38) 
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39) 
    at link (node:internal/modules/esm/module_job:86:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
Error: Cannot find package 'C:\Users\USER\Documents\Programming\open-source\magicui\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected]_qyaeezilld56lj2pad6hqnrkxu\node_modules\@opentelemetry\exporter-trace-otlp-grpc\package.json' imported from C:\Users\USER\Documents\Programming\open-source\magicui\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected]_qyaeezilld56lj2pad6hqnrkxu\node_modules\@effect-ts\otel-exporter-trace-otlp-grpc\_mjs\index.mjs
Did you mean to import "@opentelemetry/exporter-trace-otlp-grpc/build/src/index.js"?
    at legacyMainResolve (node:internal/modules/esm/resolve:215:26)        
    at packageResolve (node:internal/modules/esm/resolve:841:14)
    at moduleResolve (node:internal/modules/esm/resolve:927:18)
    at defaultResolve (node:internal/modules/esm/resolve:1157:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)      
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38) 
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39) 
    at link (node:internal/modules/esm/module_job:86:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
 ⨯ Error: Cannot find package 'C:\Users\USER\Documents\Programming\open-source\magicui\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected]_qyaeezilld56lj2pad6hqnrkxu\node_modules\@opentelemetry\exporter-trace-otlp-grpc\package.json' imported from C:\Users\USER\Documents\Programming\open-source\magicui\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected]_qyaeezilld56lj2pad6hqnrkxu\node_modules\@effect-ts\otel-exporter-trace-otlp-grpc\_mjs\index.mjs
Did you mean to import "@opentelemetry/exporter-trace-otlp-grpc/build/src/index.js"?
    at legacyMainResolve (node:internal/modules/esm/resolve:215:26)        
    at packageResolve (node:internal/modules/esm/resolve:841:14)
    at moduleResolve (node:internal/modules/esm/resolve:927:18)
    at defaultResolve (node:internal/modules/esm/resolve:1157:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)      
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38) 
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39) 
    at link (node:internal/modules/esm/module_job:86:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Please do you have any idea how I can fix this?

[text animation] wavy text

A good friend @ChrisAbdo has been incredibly kind and given us permission to merge some of his framer motion components into the Magic UI Repo!

https://github.com/chrisabdo/motionvariants
https://variantvault.chrisabdo.dev/text-variants

This issue requires copying the text animation component from variantvault and adding it to Magic UI. Also maybe some fixes to the classnames here.

Please refer to #12 for guidelines on how to submit a PR with this new component

Screen.Recording.2024-05-21.at.8.00.45.PM.mov

Unable to access login

I'm trying to log into Magic UI.

  1. Typed my registered Email address. Clicked Submit button
  2. A notification appeared to look into my mailbox for link.
  3. After 5 minutes, I got email with link
  4. When I clicked on the link, it says the link is expired.

I tried multiple times but of no success.

Magic UI for Svelte 5

I'm making this issue to track any ports of Magic UI components to Svelte

If you have any ports, feel free to comment them below to share with the community!

We will eventually try and merge everything together in one repo if possible down the line.

However our current priority will be on react first.

If someone from the community wants to take initiative to integrate Svelte support into this repo please feel free to comment below and get started :) No permission needed

[text animation] fade in

A good friend @ChrisAbdo has been incredibly kind and given us permission to merge some of his framer motion components into the Magic UI Repo!

https://github.com/chrisabdo/motionvariants
https://variantvault.chrisabdo.dev/text-variants

This issue requires a bit more work than the others. This issue requires copying the text animation component from variantvault and adding it to Magic UI plus some additional steps.

I think the best way to go about this is to add a default "fade-up" variant, and then also make 3 other variants showcasing the other directions.

The variants would be:

  1. fade up
  2. fade left
  3. fade right
  4. fade down

Any good abstraction layer would be helpful here too if you have any ideas

Screen.Recording.2024-05-21.at.7.36.17.PM.mov

[HELP] Discord community for MagicUI library

Magic UI Library Discord Server Proposal

Purpose

Create a dedicated Discord community for developers and users of the Magic UI library to enhance communication and collaboration.

Server Structure

General Channels

  • #welcome: Introductions and rules.
  • #announcements: Official updates.

Developer Channels

  • #dev-general: Developer discussions.
  • #dev-help: Support for developers.
  • #dev-collaboration: Find collaborators.

User Channels

  • #user-general: User discussions.
  • #user-showcase: Project showcases.
  • #user-support: Support for users.
  • #user-feedback: User feedback.

Resource Channels

  • #resources: Documentation and tutorials.
  • #community-resources: User-created resources.

Off-topic Channels

  • #off-topic: Non-technical discussions.
  • #memes: Fun content.

Roles and Permissions

  • Admin: Full control.
  • Moderator: Manage and moderate.
  • Developer: Access developer channels.
  • User: Access user channels.
  • Guest: Limited access.

Guidelines

  • Respectful Communication: Be inclusive and respectful.
  • No Spam: Keep channels relevant.
  • Support Etiquette: Provide clear questions and context.

Misalignment of "Installation" in table of contents

The Installation item in the table of contents seems to be incorrectly aligned, causing unnecessary spacing. I'm guessing that it's probably not at the same level as the other contents (as in nested), I could be wrong though.

Screenshot 2024-05-28 at 1 02 46 PM

[text animation] typing animation

A good friend @ChrisAbdo has been incredibly kind and given us permission to merge some of his framer motion components into the Magic UI Repo!

https://github.com/chrisabdo/motionvariants
https://variantvault.chrisabdo.dev/text-variants

This issue requires copying the text animation component from variantvault and adding it to Magic UI.

Please refer to #12 for guidelines on how to submit a PR with this new component

Screen.Recording.2024-05-21.at.2.20.00.PM.mov

Failed to run locally

localhost:3000 Error
240523_13h38m35s_screenshot

Terminal Log
240523_13h47m32s_screenshot

So, I'm new to magicui community I have forked the project and follow the step in contribution.md but after running the project I was facing this error I wasn't able to find out the ERROR can some help me fixing this

Issue: Migrate Components to CRA/Vite from Next.js

To make the library more versatile and easier to integrate with various projects, I propose migrating the components to work with Create React App (CRA) and Vite. This will allow developers who do not use Next.js to benefit from the components and will enhance the overall usability and adoption of our library.

Objectives:

  1. Decouple components from Next.js: Ensure all components are independent of Next.js-specific features.
  2. Create a build process for CRA and Vite: Set up the necessary configuration and scripts for both CRA and Vite.
  3. Maintain backward compatibility: Ensure the components remain usable with Next.js after migration.
  4. Update documentation: Provide clear instructions on how to use the components with CRA and Vite.

Expected Outcome:
The migration should result in fully functional components that run seamlessly in CRA/Vite, and Next.js with the same functionalities and appearance

[text animation] Staggered Fade In

A good friend @ChrisAbdo has been incredibly kind and given us permission to merge some of his framer motion components into the Magic UI Repo!

https://github.com/chrisabdo/motionvariants
https://variantvault.chrisabdo.dev/text-variants

This issue requires copying the text animation component from variantvault and adding it to Magic UI.

Steps

  1. Please assign issue to yourself or comment below if you are working on it
  2. Please refer to #12 for guidelines on how to submit a PR with this new component
Screen.Recording.2024-05-21.at.2.15.49.PM.mov

Letter pullup preview text not visible in dark mode

Preview text of "Staggered Letter Pull Up Animation" is not visible when dark mode is enabled. This may be due to an error in the className

Screenshot 2024-05-24 at 8 43 40 PM

Here's the corrected version:

Screenshot 2024-05-24 at 8 45 04 PM

I'd like to be assigned this issue, please.

[HELP NEEDED] Need help spreading the word about Magic UI!

Hi friends :)

I'd love your help to spread the word about Magic UI as far as possible!

If you share it somewhere please comment it below so we can keep track :)

Ideas:

[Special Effect] Confetti Animations!

Confetti??? 🎉

We should definitely have some nice, clean, tasteful, and easy to use confetti animations that devs can just import into their products.

Every person should be able to do this easily.

For example, I like the clean one shown here.

https://wope.com/

We should credit everyone who we take inspiration from!

Screen.Recording.2024-05-25.at.4.41.02.PM.mov

[ Error ] Bento Grid Error

Bento Grid is showing this error
image

And why is this component is async in this example?

export async function BentoDemo() {
  return (
    <BentoGrid className="lg:grid-rows-3">
      {features.map((feature) => (
        <BentoCard key={feature.name} {...feature} />
      ))}
    </BentoGrid>
  );
}

[Developer Experience] We need a Magic UI CLI!

Something just like this would be amazing! https://ui.shadcn.com/docs/cli

We should be able to install magicui directly from the cli

Ideal Developer Experience Flow

npx magicui@latest init
npx magicui@latest add border-beam

How to start?

Read through the shadcn cli and how it was first implemented for the MVP shadcn-ui/ui#112
Read through the current cli package and see how it was improved https://github.com/shadcn-ui/ui/tree/main/packages/cli
Implement the same foundation here :)

[text animation] Scroll Based Velocity Text

A good friend @ChrisAbdo has been incredibly kind and given us permission to merge some of his framer motion components into the Magic UI Repo!

This issue requires copying the text animation component from variantvault and adding it to Magic UI.

https://github.com/chrisabdo/motionvariants
https://variantvault.chrisabdo.dev/text-variants

Screen.Recording.2024-05-21.at.2.09.37.PM.mov

Please refer to #12 for guidelines on how to submit a PR with this new component

[effect] shine border

https://codepen.io/matthewgoshman/pen/bGMpKZy

This one is awesome! Would be sweet to recreate this in react / typescript with props for configurability.

Requirements:

  • light/dark mode support
  • typescript props for configurability

Please assign issue to yourself or comment below if you want to tackle this :)

Also we must credit original author!

Magic UI for VueJS

I'm making this issue to track any ports of Magic UI components to VueJS

If you have any ports, feel free to comment them below to share with the community!

We will eventually try and merge everything together in one repo if possible down the line.

However our current priority will be on react first.

If someone from the community wants to take initiative to integrate VueJS support into this repo please feel free to comment below and get started :) No permission needed

Contentlayer warning on Windows - Warning: Contentlayer might not work as expected on Windows

After downgrading my Node version to v18 from v20 in order to make the content layer dependency to work, but weirdly it prompts a warning whenever I run the pnpm dev command. Here is what happens:


WARN  Unsupported engine: wanted: {"node":">=20.6.1"} (current: {"node":"v18.17.0","pnpm":"9.0.4"})

[email protected] dev C:\Users\USER\Documents\Programming\open-source\magicui
next dev

▲ Next.js 14.1.0

  • Local: http://localhost:3000
  • Environments: .env.local
  • Experiments (use at your own risk):
    · optimizeCss

Warning: Contentlayer might not work as expected on Windows
✓ Ready in 63.8s
Contentlayer config change detected. Updating type definitions and data...
Warning: Found 23 problems in 49 documents.

└── 23 documents contain field data which didn't match the structure defined in the document type definition. (Skipping documents)

 • "docs/changelog.mdx" of type "Doc" has the following incompatible fields:       
   • published: "false\r"
 • "docs/installation.mdx" of type "Doc" has the following incompatible fields:    
   • published: "true\r"
 • "docs/story.mdx" of type "Doc" has the following incompatible fields:
   • published: "false\r"
 • "docs/components/animated-grid-pattern.mdx" of type "Doc" has the following incompatible fields:
   • published: "true\r"
 • "docs/components/animated-list.mdx" of type "Doc" has the following incompatible fields:
   • published: "true\r"
 • "docs/components/avatar-circles.mdx" of type "Doc" has the following incompatible fields:
   • published: "true\r"
 • "docs/components/bento-grid.mdx" of type "Doc" has the following incompatible fields:
   • published: "true\r"
 • "docs/components/blur-in.mdx" of type "Doc" has the following incompatible fields:
   • published: "true\r"
 • "docs/components/box-reveal.mdx" of type "Doc" has the following incompatible fields:
   • published: "true\r"
 • "docs/components/fade-text.mdx" of type "Doc" has the following incompatible fields:
   • published: "true\r"
 • "docs/components/flip-text.mdx" of type "Doc" has the following incompatible fields:
   • published: "true\r"
 • "docs/components/gradual-spacing.mdx" of type "Doc" has the following incompatible fields:
   • published: "true\r"
 • "docs/components/icon-cloud.mdx" of type "Doc" has the following incompatible fields:
   • published: "true\r"
 • "docs/components/letter-pullup.mdx" of type "Doc" has the following incompatible fields:
   • published: "true\r"
 • "docs/components/scroll-based-velocity.mdx" of type "Doc" has the following incompatible fields:
   • published: "true\r"
 • "docs/components/separate-away.mdx" of type "Doc" has the following incompatible fields:
   • published: "true\r"
 • "docs/components/shine-border.mdx" of type "Doc" has the following incompatible fields:
   • published: "true\r"
 • "docs/components/shiny-button.mdx" of type "Doc" has the following incompatible fields:
   • published: "true\r"
 • "docs/components/typing-animation.mdx" of type "Doc" has the following incompatible fields:
   • published: "true\r"
 • "docs/components/wavy-text.mdx" of type "Doc" has the following incompatible fields:
   • published: "true\r"
 • ... 3 more documents (Use the --verbose CLI option to show all documents)      

Generated 26 documents in .contentlayer

Can someone please suggest a fix to this?

[text animation] flip text

A good friend @ChrisAbdo has been incredibly kind and given us permission to merge some of his framer motion components into the Magic UI Repo!

https://github.com/chrisabdo/motionvariants
https://variantvault.chrisabdo.dev/text-variants

This issue requires copying the text animation component from variantvault and adding it to Magic UI. Also maybe some fixes to the classnames here.

Please refer to #12 for guidelines on how to submit a PR with this new component

Screen.Recording.2024-05-21.at.8.02.04.PM.mov

[button] - New Pulsating Button

beautiful button here 😍

Screen.Recording.2024-02-28.at.11.37.51.AM.mov

we should re-create this in react + typescript + tailwindcss :)

Magic UI for JS / HTML

Any plans to have a React-free version in Vanilla JS or WC for compatibility with other frameworks like Vue, Svelte etc?

Border Beam + Shimmer Button for Svelte

Borderbeam

<script lang="ts">
	import { cn } from '$lib/utils';

	interface Props {
		class?: string;
		size?: number;
		duration?: number;
		borderWidth?: number;
		anchor?: number;
		colorFrom?: string;
		colorTo?: string;
		delay?: number;
	}

	let {
		class: className,
		size = 200,
		duration = 15,
		anchor = 90,
		borderWidth = 1.5,
		colorFrom = '#ffaa40',
		colorTo = '#9c40ff',
		delay = 0
	}: Props = $props();

	let styleVars = $derived.by(() => {
		return `--size: ${size}; 
            --duration: ${duration}; 
            --anchor: ${anchor}; 
            --border-width: ${borderWidth}; 
            --color-from: ${colorFrom}; 
            --color-to: ${colorTo}; 
            --delay: -${delay}s;`;
	});
</script>

<div
	style={styleVars}
	class={cn(
		'absolute inset-[0] rounded-[inherit] [border:calc(var(--border-width)*1px)_solid_transparent]',

		// mask styles
		'![mask-clip:padding-box,border-box] ![mask-composite:intersect] [mask:linear-gradient(transparent,transparent),linear-gradient(white,white)]',

		// pseudo styles
		'after:absolute after:aspect-square after:w-[calc(var(--size)*1px)] after:animate-border-beam after:[animation-delay:var(--delay)] after:[background:linear-gradient(to_left,var(--color-from),var(--color-to),transparent)] after:[offset-anchor:calc(var(--anchor)*1%)_50%] after:[offset-path:rect(0_auto_auto_0_round_calc(var(--size)*1px))]',
		className
	)}
></div>

Shimmer Button

<script lang="ts">
	import { cn } from '$lib/utils';
	import type { Snippet } from 'svelte';
	import type { HTMLButtonAttributes } from 'svelte/elements';

	interface ShimmerButtonProps extends HTMLButtonAttributes {
		shimmerColor?: string;
		shimmerSize?: string;
		borderRadius?: string;
		shimmerDuration?: string;
		background?: string;
		class?: string;
		children?: Snippet;
	}

	let {
		shimmerColor = '#ffffff',
		shimmerSize = '0.05em',
		shimmerDuration = '3s',
		borderRadius = '100px',
		background = 'rgba(0, 0, 0, 1)',
		class: className,
		children,
		...restProps
	}: ShimmerButtonProps = $props();

	let styleVars = $derived.by(() => {
		return `--spread: 90deg; 
            --shimmer-color:${shimmerColor}; 
            --radius: ${borderRadius}; 
            --speed: ${shimmerDuration}; 
            --cut: ${shimmerSize}; 
            --bg: ${background};`;
	});
</script>

<button
	style={styleVars}
	class={cn(
		'group relative z-0 flex cursor-pointer items-center justify-center overflow-hidden whitespace-nowrap border border-white/10 px-6 py-3 text-white [background:var(--bg)] [border-radius:var(--radius)] dark:text-black',
		'transform-gpu transition-transform duration-300 ease-in-out active:translate-y-[1px]',
		className
	)}
	{...restProps}
>
	<!-- spark container -->
	<div class={cn('-z-30 blur-[2px]', 'absolute inset-0 overflow-visible [container-type:size]')}>
		<!-- spark -->
		<div
			class="animate-slide absolute inset-0 h-[100cqh] [aspect-ratio:1] [border-radius:0] [mask:none]"
		>
			<!-- spark before -->
			<div
				class="animate-spin-around absolute inset-[-100%] w-auto rotate-0 [background:conic-gradient(from_calc(270deg-(var(--spread)*0.5)),transparent_0,var(--shimmer-color)_var(--spread),transparent_var(--spread))] [translate:0_0]"
			></div>
		</div>
	</div>
	{#if children}
		{@render children()}
	{/if}

	<!-- Highlight -->
	<div
		class={cn(
			'insert-0 absolute h-full w-full',

			'rounded-2xl px-4 py-1.5 text-sm font-medium shadow-[inset_0_-8px_10px_#ffffff1f]',

			// transition
			'transform-gpu transition-all duration-300 ease-in-out',

			// on hover
			'group-hover:shadow-[inset_0_-6px_10px_#ffffff3f]',

			// on click
			'group-active:shadow-[inset_0_-10px_10px_#ffffff3f]'
		)}
	></div>

	<!-- backdrop -->
	<div
		class={cn(
			'absolute -z-20 [background:var(--bg)] [border-radius:var(--radius)] [inset:var(--cut)]'
		)}
	></div>
</button>

[performance] Poor performance and scroll stuttering on landing page from Globe

A lot of complaints regarding intensive gpu usage that damages UX and first impressions. This is especially prominent on non-MacOS devices. On my windows laptop, roughly 100% of my GPU is being used on the front page.

A preliminary inspection I conducted showed that the Globe, cobe, is really resource intensive. I haven't done much profiling besides that, but you'd wanna see if the following options are viable:

  • Basic performance optimizations: simplifying the shader, reduce vertices, limit framerate
  • Conditionally load the Globe(s) based on the client's device capability
  • Use WebGPU rather than WebGL?
  • Stop the animations that aren't in view

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.