Skip to content
GitHubTwitterDiscord

Component Customization Guide

This guide covers how to customize and extend LaunchKit’s components to match your specific needs and branding.

Tailwind Classes:

// Override default styles
<Button className="bg-purple-600 hover:bg-purple-700 text-white">
  Custom Button
</Button>

CSS Modules:

// Create custom styles
import styles from './CustomComponent.module.css';

<div className={styles.customContainer}>
  {/* Custom styled content */}
</div>

Add New Props:

interface ExtendedButtonProps extends ButtonProps {
  analyticsEvent?: string;
  customAction?: () => void;
}

const ExtendedButton: React.FC<ExtendedButtonProps> = ({
  analyticsEvent,
  customAction,
  ...props
}) => {
  const handleClick = () => {
    if (analyticsEvent) {
      trackEvent(analyticsEvent);
    }
    if (customAction) {
      customAction();
    }
  };

  return <Button {...props} onClick={handleClick} />;
};

Create Composite Components:

const EnhancedDashboard = () => {
  return (
    <div className="dashboard-container">
      <DashboardWelcome />
      <SectionCards />
      <ChartAreaInteractive data={analyticsData} />
      <PurchasedProducts />
    </div>
  );
};