Files
myeasycms-v2/packages/ui/src/makerkit/marketing/gradient-secondary-text.tsx
Giancarlo Buomprisco fafcafc221 Updated UI package to work with the new Shadcn CLI (#59)
Updated UI package to work with the new Shadcn CLI
2024-09-03 18:17:51 +08:00

28 lines
660 B
TypeScript

import { forwardRef } from 'react';
import { Slot, Slottable } from '@radix-ui/react-slot';
import { cn } from '../../lib/utils';
export const GradientSecondaryText = forwardRef<
HTMLSpanElement,
React.HTMLAttributes<HTMLSpanElement> & {
asChild?: boolean;
}
>(function GradientSecondaryTextComponent({ className, ...props }, ref) {
const Comp = props.asChild ? Slot : 'span';
return (
<Comp
ref={ref}
className={cn(
'bg-gradient-to-r from-foreground/50 to-foreground bg-clip-text text-transparent',
className,
)}
{...props}
>
<Slottable>{props.children}</Slottable>
</Comp>
);
});