UNPKG

react-trophies

Version:

Comprehensive achievement and trophy system for React apps with sound effects, notifications, theming, and visual components. Uses React, React-DOM, Sonner (toast notifications), Howler (sound effects), Zustand (state management), React-Confetti (celebrat

36 lines (35 loc) 1.16 kB
import React from 'react'; /** * Props for the AchievementToast component */ export interface AchievementToastProps { /** Duration in milliseconds for toasts to remain visible (default: 4000) */ duration?: number; /** Position for the toast notifications */ position?: 'top-left' | 'top-right' | 'top-center' | 'bottom-left' | 'bottom-right' | 'bottom-center'; /** Gap between toasts in pixels */ gap?: number; /** Custom icons to use for achievements */ icons?: Record<string, string>; /** Whether toasts have close buttons */ closeButton?: boolean; /** Custom toast title (default: "Achievement Unlocked!") */ toastTitle?: string; /** Whether to expand toasts on hover */ expandOnHover?: boolean; /** Custom styles for the toasts */ customToastStyles?: React.CSSProperties; } /** * AchievementToast - Automatically shows toast notifications when achievements are unlocked * Uses sonner for toast UI * * @example * ```tsx * <AchievementToast * position="bottom-right" * /> * ``` */ declare const AchievementToast: React.FC<AchievementToastProps>; export default AchievementToast;