Neon Gradient Card
Install: npx shadcn@latest add https://jiguang132.com/r/magic-ui/neon-gradient-card.json
Use case
Frame card content with an animated neon gradient.
Native props used by the examples
Extracted from all local examples for this entry, grouped by imported module and native owner, including other Magic components used by compound demos. This is not an exhaustive API or a universal host variant. Inspect spread object declarations and the source types/defaults below.
| Owning component prop | Explanation | Example source |
|---|---|---|
NeonGradientCard.className (neon-gradient-card) | Classes on this native component; initialize Tailwind and its required CSS first. | examples/neon-gradient-card-demo.tsx |
NeonGradientCard.children (neon-gradient-card) | Native child content; keep the owning component's text/element constraints. | examples/neon-gradient-card-demo.tsx |
Interaction and state checks
- Neon Gradient Card Demo —
neon-gradient-card-demo
These names identify real example entries, not new component props or extra components. Check pointer/keyboard behavior, themes, small screens and failures for the selected example. Decorative effects must not invent disabled/error/submission states. Complete example installation includes the actual dependency closure.
Business integration boundary
The card provides presentation, not selection or submission behavior. Wire actions in its children separately.
Host and motion setup
Initialize Tailwind CSS v4, semantic CSS variables and the dark variant; import the independent local Registry namespace. Reuse an existing next-themes Provider without substituting JGuang UI/Base UI/HeroUI APIs. Mount effects in view and unmount offscreen; provide static alternatives for unavailable Canvas/WebGL or failed remote media. Respect prefers-reduced-motion and verify timer/RAF/observer/listener cleanup: stopping CSS alone does not prove the engine stopped. Examples provide no backend, login, payment or real AI stream. This practical guide is bilingual; detailed upstream references and demo text retain their original language.
Available examples
neon-gradient-card-demo
Demo state and mock data do not provide a backend service. Inspect the component props before wiring real data.
Installation
<Tabs defaultValue="cli"> <TabsList> <TabsTrigger value="cli">CLI</TabsTrigger> <TabsTrigger value="manual">Manual</TabsTrigger> </TabsList> <TabsContent value="cli">npx shadcn@latest add @magicui/neon-gradient-card
</TabsContent>
<TabsContent value="manual">
<Steps>
<Step>Copy and paste the following code into your project.</Step>
<Step>Update the import paths to match your project setup.</Step>
<Step>Add the required CSS animations</Step>
Add the following animations to your global CSS file .
@theme inline {
--animate-background-position-spin: background-position-spin 3000ms infinite
alternate;
@keyframes background-position-spin {
0% {
background-position: top center;
}
100% {
background-position: bottom center;
}
}
}
</Steps>
</TabsContent>
</Tabs>
Usage
import { NeonGradientCard } from "@/components/ui/neon-gradient-card"
<NeonGradientCard>
<div className="p-4">
<p>Hello</p>
<span>Hover me</span>
</div>
</NeonGradientCard>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | The class name to be applied to the component |
children | ReactNode | - | Children elements |
borderSize | number | 5 | The size of the border |
borderRadius | number | 20 | The size of the radius |
neonColors | object | { firstColor: "#ff00aa", secondColor: "#00FFF1" } | The colors of the neon gradient |
Credits
- Credit to @Unleashed-Design
Complete example installation
The component command installs the component. Each example command also includes its actual imported components, native support UI, utilities and pinned dependencies. Helpers are not additional catalog components.
Neon Gradient Card Demo
npx shadcn@latest add https://jiguang132.com/r/magic-ui/examples/neon-gradient-card/neon-gradient-card-demo.json
Default import: @/components/magicui/examples/neon-gradient-card-demo
Dependencies: clsx@2.1.1, tailwind-merge@3.6.0
Minimal usage and theme
import Demo from '@/components/magicui/examples/neon-gradient-card-demo';
import { ThemeProvider } from 'next-themes';
export default function Example() {
return <ThemeProvider attribute="class" defaultTheme="system" enableSystem><Demo /></ThemeProvider>;
}
Initialize Tailwind CSS v4, semantic color variables and the dark variant first. Reuse an existing next-themes provider rather than nesting another. Next Link examples require a Next.js environment; in static Vite projects adapt the demo links to your router without changing the native component API. Some media and tweets require network access. Examples do not supply authentication or backend services.
Source-backed parameter reference
Implementation signatures and types are generated from the pinned local source. Optional props, native inherited types, union branches and never exclusions are preserved. A forwardRef implementation's ref is a React reference, not an additional business prop.
NeonGradientCard({
className,
children,
borderSize = 2,
borderRadius = 20,
neonColors = {
firstColor: "#ff00aa",
secondColor: "#00FFF1",
},
...props
})
interface NeonColorsProps {
firstColor: string
secondColor: string
}
interface NeonGradientCardProps extends React.HTMLAttributes<HTMLDivElement> {
/**
* @default <div />
* @type ReactElement
* @description
* The component to be rendered as the card
* */
as?: ReactElement
/**
* @default ""
* @type string
* @description
* The className of the card
*/
className?: string
/**
* @default ""
* @type ReactNode
* @description
* The children of the card
* */
children?: ReactNode
/**
* @default 5
* @type number
* @description
* The size of the border in pixels
* */
borderSize?: number
/**
* @default 20
* @type number
* @description
* The size of the radius in pixels
* */
borderRadius?: number
/**
* @default "{ firstColor: '#ff00aa', secondColor: '#00FFF1' }"
* @type string
* @description
* The colors of the neon gradient
* */
neonColors?: NeonColorsProps
}
Destructuring defaults in source
Only defaults written directly in parameter/props destructuring are listed. Conditional expressions, runtime theme and computed values require source inspection; this is not an exhaustive behavior-default list.
// NeonGradientCard
borderSize = 2
// NeonGradientCard
borderRadius = 20
// NeonGradientCard
neonColors = {
firstColor: "#ff00aa",
secondColor: "#00FFF1",
}
Native and external types
External types remain defined by React or native dependencies, not manually expanded into guessed props. The installed version's TypeScript definitions are authoritative.
React.FC<NeonGradientCardProps>
React.HTMLAttributes<HTMLDivElement>
HTMLDivElement
ReactElement
ReactNode