react-creative-text
Version:
A powerful React component for creating beautiful, customizable text with SVG. Support for Google Fonts, strokes, shadows, 1000+ fonts families and more.
45 lines (44 loc) • 1.38 kB
TypeScript
import React from 'react';
import { googleFontFamilies } from '@/constants/googleFontFamilies';
export type GoogleFontFamily = (typeof googleFontFamilies)[number];
export type DirectionType = 'horizontal' | 'vertical' | 'diagonal';
export type AnimationType = 'none' | 'fade' | 'slide' | 'bounce' | 'glow';
export type TextTransformType = 'none' | 'uppercase' | 'lowercase' | 'capitalize';
export interface CreativeTextProps {
children: string;
fontFamily?: GoogleFontFamily;
fontSize?: number | string;
color?: string;
strokeColor?: string;
strokeWidth?: number;
shadow?: boolean | {
offsetX?: number;
offsetY?: number;
blur?: number;
color?: string;
opacity?: number;
};
gradient?: {
colors: string[];
direction?: DirectionType;
};
animation?: AnimationType;
responsive?: boolean;
maxWidth?: number | string;
className?: string;
style?: React.CSSProperties;
onFontLoad?: () => void;
onFontError?: (error: unknown) => void;
fallbackFont?: string;
letterSpacing?: number | string;
lineHeight?: number | string;
textTransform?: TextTransformType;
opacity?: number;
rotation?: number;
skew?: {
x?: number;
y?: number;
};
}
declare const CreativeText: React.FC<CreativeTextProps>;
export default CreativeText;