MCPcopy Index your code
hub / github.com/code-forge-io/react-router-devtools / Button

Function Button

docs/app/components/ui/Button.tsx:6–57  ·  view source on GitHub ↗
({
	borderRadius = "1.75rem",
	children,
	as: Component = "button",
	containerClassName,
	borderClassName,
	duration,
	className,
	...otherProps
}: {
	borderRadius?: string
	children: React.ReactNode
	as?: any
	containerClassName?: string
	borderClassName?: string
	duration?: number
	className?: string
	[key: string]: any
})

Source from the content-addressed store, hash-verified

4import { cn } from "~/utils/css"
5
6export function Button({
7 borderRadius = "1.75rem",
8 children,
9 as: Component = "button",
10 containerClassName,
11 borderClassName,
12 duration,
13 className,
14 ...otherProps
15}: {
16 borderRadius?: string
17 children: React.ReactNode
18 as?: any
19 containerClassName?: string
20 borderClassName?: string
21 duration?: number
22 className?: string
23 [key: string]: any
24}) {
25 return (
26 <Component
27 className={cn("relative h-16 w-40 overflow-hidden bg-transparent p-[1px] text-xl ", containerClassName)}
28 style={{
29 borderRadius: borderRadius,
30 }}
31 {...otherProps}
32 >
33 <div className="absolute inset-0" style={{ borderRadius: `calc(${borderRadius} * 0.96)` }}>
34 <MovingBorder duration={duration} rx="30%" ry="30%">
35 <div
36 className={cn(
37 "h-20 w-20 bg-[radial-gradient(var(--sky-500)_40%,transparent_60%)] opacity-[0.8]",
38 borderClassName
39 )}
40 />
41 </MovingBorder>
42 </div>
43
44 <div
45 className={cn(
46 "relative flex h-full w-full items-center justify-center border border-slate-800 bg-slate-900/[0.8] text-sm text-white antialiased backdrop-blur-xl",
47 className
48 )}
49 style={{
50 borderRadius: `calc(${borderRadius} * 0.96)`,
51 }}
52 >
53 {children}
54 </div>
55 </Component>
56 )
57}
58
59const MovingBorder = ({
60 children,

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…