🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

landing-page-creator

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

landing-page-creator

A React component library for building beautiful landing pages

latest
Source
npmnpm
Version
0.7.9
Version published
Weekly downloads
29
190%
Maintainers
1
Weekly downloads
 
Created
Source

Landing Page Creator

A React component library for building beautiful landing pages with pre-styled components. Built with TypeScript and designed for modern React applications.

GitHub npm version License: MIT

Table of Contents

Installation

npm install landing-page-creator

Peer Dependencies

This package requires React 19.2.0 or higher:

npm install react@^19.2.0 react-dom@^19.2.0

Setup

⚠️ Important: Import CSS

You must import the CSS file for styles to work correctly. Choose one of the following methods:

Option 1: In your main entry file

// In index.js, App.js, or _app.js
import 'landing-page-creator/styles.css';

Option 2: Direct import

import 'landing-page-creator/dist/styles.css';

Option 3: In your CSS/SCSS file

@import 'landing-page-creator/styles.css';

Quick Start

import { CustomButton, Hero, StatsGrid, Overview, Card, StickyNav, Footer, InfoWithImages, ImageCardGrid, AlternatingContentSection, Carousel, Form } from 'landing-page-creator';
import 'landing-page-creator/styles.css'; // ⚠️ Don't forget this!

function App() {
  return (
    <div>
      {/* Using Hero section */}
      <Hero
        title="Welcome to Our Platform"
        subtitle="Get Started Today"
        description="Build amazing landing pages with ease"
        primaryButtonText="Get Started"
        primaryButtonUrl="/signup"
      />
      
      {/* Using StatsGrid */}
      <StatsGrid 
        stats={[
          { label: "Happy Customers", value: "10K", unit: "+" },
          { label: "Projects Completed", value: "500" },
          { label: "Team Members", value: "50", unit: "+" },
          { label: "Years of Experience", value: "10", unit: "+" }
        ]}
        columns={4}
        showHover={true}
      />
      
      {/* Using InfoWithImages */}
      <InfoWithImages
        title="Our Story"
        paragraphs={[
          "We started with a vision to simplify web development.",
          "Today, we serve thousands of developers worldwide."
        ]}
        images={[
          { src: "image1.jpg", alt: "Our story" }
        ]}
        primaryButton={{
          text: "Learn More",
          url: "/about",
          variant: "black"
        }}
      />
      
      {/* Using ImageCardGrid */}
      <ImageCardGrid
        title="Our Products"
        items={[
          { image: "product1.jpg", title: "Product 1", description: "Description" },
          { image: "product2.jpg", title: "Product 2", description: "Description" }
        ]}
      />
      
      {/* Using AlternatingContentSection */}
      <AlternatingContentSection
        title="Our Features"
        items={[
          { image: "feature1.jpg", title: "Feature 1", description: "Description" },
          { image: "feature2.jpg", title: "Feature 2", description: "Description" }
        ]}
      />
      
      {/* Using Carousel */}
      <Carousel
        showThumbnails={true}
        showArrows={true}
        showPagination={true}
        autoplay={3000}
        loop={true}
      >
        <img src="image1.jpg" alt="Slide 1" />
        <img src="image2.jpg" alt="Slide 2" />
        <img src="image3.jpg" alt="Slide 3" />
      </Carousel>
      
      {/* Using Overview */}
      <Overview
        title="About Our Platform"
        subtitle="Innovation"
        description="This is an amazing platform that solves real-world problems."
        highlights={[
          { label: "Fast", value: "Lightning Speed" },
          { label: "Secure", value: "Enterprise Grade" },
          { label: "Scalable", value: "Grows with You" }
        ]}
      />
      
      {/* Using CustomButton */}
      <CustomButton variant="black" text="Click Me" />

      {/* Using Form with inline validation and phone field */}
      <Form
        title="Stay Updated"
        description="Sign up to receive product news and updates."
        image="https://example.com/signup.jpg"
        imagePosition="left"
        initialValues={{
          name: "",
          email: "",
          phone: "",
          message: "",
        }}
        fields={[
          { name: "name", label: "Full Name", required: true, validation: { min: 2 } },
          { name: "email", label: "Email Address", type: "email", required: true },
          { name: "phone", label: "Phone Number", type: "phone", defaultCountry: "US" },
          { name: "message", label: "How can we help?", type: "textarea", rows: 4 },
        ]}
        submitText="Submit"
        submitVariant="black"
        onSubmit={(values) => console.log(values)}
        paddingY="4rem"
        contentPaddingX="3rem"
      />
    </div>
  );
}

Components

CustomButton

A highly customizable button component with multiple style variants, sizes, and the ability to render as either a button or a link.

Props

PropTypeDefaultRequiredDescription
textstring-Button text content
variant"black" | "white" | "red" | "gray" | "lime" | "transparent-black" | "transparent-white" | "transparent-red" | "transparent-gray" | "transparent-lime""black"Button style variant
size"sm" | "md" | "lg""md"Button size
shape"rounded" | "square""rounded"Button shape
unstyledbooleanfalseSkip all default styles, use only className
urlstring-Render as link with this URL
blankbooleanfalseOpen link in new tab (only works with url)
onClick() => void-Click handler function
classNamestring-Additional CSS classes
...propsButtonHTMLAttributes-All standard HTML button attributes

Variants

  • Solid colors: black, white, red, gray, lime
  • Transparent: transparent-black, transparent-white, transparent-red, transparent-gray, transparent-lime

Examples

// Basic usage
<CustomButton variant="black" text="Click Me" />

// Different variants
<CustomButton variant="red" text="Primary Action" />
<CustomButton variant="lime" text="Success" />
<CustomButton variant="transparent-black" text="Outline Style" />
<CustomButton variant="transparent-white" text="Ghost Button" />

// Size variations
<CustomButton variant="black" size="sm" text="Small" />
<CustomButton variant="black" size="md" text="Medium" />
<CustomButton variant="black" size="lg" text="Large" />

// Shape variations
<CustomButton variant="black" shape="rounded" text="Rounded" />
<CustomButton variant="black" shape="square" text="Square" />

// Button as link
<CustomButton variant="red" url="/signup" text="Sign Up" />

// Link opens in new tab
<CustomButton 
  variant="transparent-black" 
  url="https://example.com" 
  blank 
  text="External Link" 
/>

// With onClick handler
<CustomButton 
  variant="black" 
  text="Click Me" 
  onClick={() => console.log('Clicked!')} 
/>

// Fully custom (unstyled)
<CustomButton unstyled className="my-custom-class" text="Custom" />

// Standard HTML attributes
<CustomButton 
  variant="black" 
  text="Submit" 
  type="submit" 
  aria-label="Submit form"
/>

Hero

A full-width hero section component perfect for landing page headers. Supports background images, customizable text alignment, CTA buttons, and additional child content rendered directly beneath the core hero content.

Props

PropTypeDefaultRequiredDescription
titlestring-Main heading text
subtitlestring-Subtitle text displayed above title
descriptionstring-Description text displayed below title
primaryButtonTextstring-Primary CTA button text
primaryButtonUrlstring-Primary CTA button URL
primaryButtonVariantButtonVariant"black"Primary button style variant
secondaryButtonTextstring-Secondary CTA button text
secondaryButtonUrlstring-Secondary CTA button URL
secondaryButtonVariantButtonVariant"transparent-black"Secondary button style variant
backgroundColorstring"#ffffff"Background color (used when no backgroundImage)
backgroundImagestring-Background image URL
overlayOpacitynumber0.4Background overlay opacity (0-1), only applies with backgroundImage
textColorstring-Text color (auto-detected if not provided)
align"left" | "center" | "right""center"Text alignment
minHeightstring"500px"Minimum height of the hero section
paddingXstring-Horizontal padding (desktop). Accepts any CSS unit (e.g., "2rem", "48px", "5vh"). If not provided, defaults to 0
paddingXMobilestring-Horizontal padding (mobile). Accepts any CSS unit. If not provided, defaults to 0
paddingYstring-Vertical padding (desktop). Accepts any CSS unit. If not provided, defaults to 0
paddingYMobilestring-Vertical padding (mobile). Accepts any CSS unit. If not provided, defaults to 0
paddingTopstring-Top padding (desktop). Accepts any CSS unit. If not provided, falls back to paddingY
paddingTopMobilestring-Top padding (mobile). Accepts any CSS unit. If not provided, falls back to paddingYMobile
paddingBottomstring-Bottom padding (desktop). Accepts any CSS unit. If not provided, falls back to paddingY
paddingBottomMobilestring-Bottom padding (mobile). Accepts any CSS unit. If not provided, falls back to paddingYMobile
classNamestring-Additional CSS classes
childrenReact.ReactNode-Additional content to render

ButtonVariant = "black" \| "white" \| "red" \| "gray" \| "lime" \| "transparent-black" \| "transparent-white" \| "transparent-red" \| "transparent-gray" \| "transparent-lime"

Examples

// Minimal hero with just a title
<Hero title="Welcome to Our Platform" />

// Basic hero with all text elements
<Hero
  title="Build Amazing Products"
  subtitle="Get Started Today"
  description="Join thousands of developers building with our platform"
  primaryButtonText="Get Started"
  primaryButtonUrl="/signup"
/>

// Hero with background color
<Hero
  title="Modern Design"
  description="Beautiful, responsive components"
  backgroundColor="#f0f0f0"
  primaryButtonText="Learn More"
  primaryButtonUrl="/about"
/>

// Hero with background image
<Hero
  title="Adventure Awaits"
  subtitle="Explore New Possibilities"
  description="Discover what makes us different"
  backgroundImage="https://example.com/hero-bg.jpg"
  overlayOpacity={0.5}
  primaryButtonText="Start Journey"
  primaryButtonUrl="/explore"
/>

// Hero with both primary and secondary buttons
<Hero
  title="Choose Your Plan"
  description="Pick the perfect plan for your needs"
  primaryButtonText="Start Free Trial"
  primaryButtonUrl="/trial"
  primaryButtonVariant="red"
  secondaryButtonText="Learn More"
  secondaryButtonUrl="/pricing"
  secondaryButtonVariant="transparent-white"
/>

// Left-aligned hero
<Hero
  title="Innovation Starts Here"
  subtitle="Technology"
  description="Leading the future of development"
  align="left"
  backgroundColor="#2c3e50"
  textColor="#ffffff"
  primaryButtonText="Join Us"
  primaryButtonUrl="/join"
  primaryButtonVariant="lime"
/>

// Hero with custom height and additional content rendered underneath
<Hero
  title="Customizable Hero"
  description="Add any content you want"
  minHeight="600px"
  backgroundImage="https://example.com/bg.jpg"
>
  <TestimonialsCarousel />
</Hero>

// Hero with custom styling
<Hero
  title="Styled Hero"
  description="With custom className"
  className="my-custom-hero"
  backgroundColor="#1a1a1a"
  textColor="#fff"
  primaryButtonText="Get Started"
  primaryButtonUrl="/start"
/>

// Hero with custom padding (default is 0, so you set it explicitly)
<Hero
  title="Hero with Custom Padding"
  description="Responsive padding controls - accepts any CSS unit"
  paddingX="6rem"
  paddingXMobile="1.5rem"
  paddingY="5rem"
  paddingYMobile="3rem"
  backgroundImage="https://example.com/hero.jpg"
/>

// Different CSS units work too
<Hero
  title="Flexible Units"
  paddingX="48px"
  paddingY="10vh"
  paddingXMobile="16px"
  paddingYMobile="5vh"
/>

// Using paddingTop/paddingBottom for granular control
<Hero
  title="Custom Top/Bottom Padding"
  paddingTop="5rem"
  paddingBottom="2rem"
  // paddingY is not used when paddingTop/paddingBottom are set
/>

// Mix: paddingTop overrides, bottom uses paddingY
<Hero
  title="Mixed Padding"
  paddingY="3rem"        // Applied to bottom (and top if paddingTop not set)
  paddingTop="5rem"      // Overrides top from paddingY
  // Result: top = 5rem, bottom = 3rem
/>

StatsGrid

A flexible statistics grid component for displaying key metrics and data points. Perfect for showcasing numbers, achievements, or statistics in a clean grid layout.

Props

PropTypeDefaultRequiredDescription
statsStatItem[]-Array of stat items to display
columns2 | 3 | 44Number of columns in the grid
classNamestring-Additional CSS classes
showHoverbooleanfalseEnable hover effects on cards
noBorderbooleanfalseRemove card borders
borderColorstring-Custom border color
textColorstring-Custom text color
backgroundColorstring-Background color
backgroundImagestring-Background image URL
paddingXstring-Horizontal padding (desktop). Accepts any CSS unit (e.g., "2rem", "48px", "5vh")
paddingXMobilestring-Horizontal padding (mobile). Accepts any CSS unit
paddingYstring-Vertical padding (desktop). Accepts any CSS unit
paddingYMobilestring-Vertical padding (mobile). Accepts any CSS unit
paddingTopstring-Top padding (desktop). Accepts any CSS unit. If not provided, falls back to paddingY
paddingTopMobilestring-Top padding (mobile). Accepts any CSS unit. If not provided, falls back to paddingYMobile
paddingBottomstring-Bottom padding (desktop). Accepts any CSS unit. If not provided, falls back to paddingY
paddingBottomMobilestring-Bottom padding (mobile). Accepts any CSS unit. If not provided, falls back to paddingYMobile

StatItem Interface

interface StatItem {
  label: string;        // Stat label/title
  value: string | number; // Stat value
  unit?: string;        // Optional unit (e.g., "+", "/5", "%")
}

Examples

// Basic usage with 4 columns
<StatsGrid 
  stats={[
    { label: "Happy Customers", value: "10K", unit: "+" },
    { label: "Projects Completed", value: "500" },
    { label: "Team Members", value: "50", unit: "+" },
    { label: "Years of Experience", value: "10", unit: "+" }
  ]} 
/>

// 3-column layout
<StatsGrid 
  stats={[
    { label: "Downloads", value: "100K", unit: "+" },
    { label: "Rating", value: "4.9", unit: "/5" },
    { label: "Reviews", value: "2.5K", unit: "+" }
  ]}
  columns={3}
/>

// 2-column layout with hover effects
<StatsGrid 
  stats={[
    { label: "Revenue", value: "$50M", unit: "+" },
    { label: "Growth", value: "150%", unit: "" }
  ]}
  columns={2}
  showHover={true}
/>

// Custom styling with colors
<StatsGrid 
  stats={[
    { label: "Products", value: "1000", unit: "+" },
    { label: "Countries", value: "50", unit: "+" }
  ]}
  borderColor="#007bff"
  textColor="#212529"
/>

// Borderless stats
<StatsGrid 
  stats={[
    { label: "Active Users", value: "25K", unit: "+" },
    { label: "Uptime", value: "99.9", unit: "%" }
  ]}
  noBorder={true}
/>

// With custom padding and background (default padding is 0)
<StatsGrid 
  stats={[
    { label: "Projects", value: "500", unit: "+" },
    { label: "Clients", value: "200", unit: "+" }
  ]}
  paddingX="4rem"
  paddingXMobile="1.5rem"
  paddingY="3rem"
  paddingYMobile="2rem"
  backgroundColor="#f9fafb"
/>

// Note: All padding props accept any CSS unit (rem, px, vh, em, etc.)
// If no padding props are provided, sections have 0 padding by default

Overview

A comprehensive overview section component that combines highlights, descriptions, and media. Perfect for project showcases, feature presentations, or product overviews.

Props

PropTypeDefaultRequiredDescription
titlestring-Main section title
subtitlestring-Subtitle text
descriptionstring | React.ReactNode-Description content (text or JSX)
highlightsHighlightItem[][]Array of highlight items
mediaMediaItem-Media item (image or video)
classNamestring-Custom CSS class for section
backgroundColorstring-Background color
backgroundImagestring-Background image URL
paddingXstring-Horizontal padding (desktop). Accepts any CSS unit (e.g., "2rem", "48px", "5vh"). If not provided, defaults to 0
paddingXMobilestring-Horizontal padding (mobile). Accepts any CSS unit. If not provided, defaults to 0
paddingYstring-Vertical padding (desktop). Accepts any CSS unit. If not provided, defaults to 0
paddingYMobilestring-Vertical padding (mobile). Accepts any CSS unit. If not provided, defaults to 0
hoverAnimationbooleantrueWhether images should have hover scale animation
paddingTopstring-Top padding (desktop). Accepts any CSS unit. If not provided, falls back to paddingY
paddingTopMobilestring-Top padding (mobile). Accepts any CSS unit. If not provided, falls back to paddingYMobile
paddingBottomstring-Bottom padding (desktop). Accepts any CSS unit. If not provided, falls back to paddingY
paddingBottomMobilestring-Bottom padding (mobile). Accepts any CSS unit. If not provided, falls back to paddingYMobile
titleClassNamestring-Custom class for title
subtitleClassNamestring-Custom class for subtitle
descriptionClassNamestring-Custom class for description
highlightsClassNamestring-Custom class for highlights
roundedCaptionbooleanfalseWhether media caption should be rounded
mediaCaptionClassNamestring-Custom class for media caption

Interfaces

interface HighlightItem {
  label: string;
  value: string;
  icon?: React.ReactNode;  // Optional icon element
}

interface MediaItem {
  type: "image" | "video";
  src: string;
  alt?: string;
  caption?: string;
}

Examples

// Basic overview with title and description
<Overview
  title="About Our Project"
  subtitle="Innovation"
  description="This is an amazing project that solves real-world problems with cutting-edge technology."
/>

// With highlights
<Overview
  title="Key Features"
  subtitle="Why Choose Us"
  highlights={[
    { label: "Fast Delivery", value: "24/7 Support" },
    { label: "Secure", value: "SSL Encrypted" },
    { label: "Scalable", value: "Grows with You" }
  ]}
/>

// With media (image) and hover animation
<Overview
  title="Our Dashboard"
  description="Beautiful and intuitive interface"
  media={{
    type: "image",
    src: "https://example.com/dashboard.jpg",
    alt: "Dashboard screenshot",
    caption: "Modern dashboard design"
  }}
  hoverAnimation={true}
/>

// With video media
<Overview
  title="Product Demo"
  subtitle="See It In Action"
  media={{
    type: "video",
    src: "https://example.com/demo.mp4",
    caption: "Full feature walkthrough"
  }}
/>

// Complete overview with all features
<Overview
  title="Complete Solution"
  subtitle="Enterprise Ready"
  description="Everything you need in one place"
  highlights={[
    { label: "Integration", value: "100+ APIs" },
    { label: "Security", value: "Enterprise Grade" },
    { label: "Support", value: "24/7 Available" }
  ]}
  media={{
    type: "image",
    src: "https://example.com/solution.jpg",
    alt: "Complete solution"
  }}
  backgroundColor="#f5f5f5"
/>

// With custom styling
<Overview
  title="Custom Styled"
  subtitle="Personalized"
  description="Fully customizable component"
  highlights={[
    { label: "Feature 1", value: "Value 1" },
    { label: "Feature 2", value: "Value 2" }
  ]}
  className="my-overview"
  titleClassName="custom-title"
  descriptionClassName="custom-description"
  backgroundColor="#ffffff"
/>

Card

A versatile card component with image, title, description, CTA button, and visual variants. Styles are provided by src/styles/card.css; the component applies matching class names so styles are picked up automatically.

Props

PropTypeDefaultRequiredDescription
titlestring-Card title
descriptionstring-Card description
imageSrcstring-Image URL
imageAltstring-Image alt text
ctaTextstring-CTA button text
ctaHrefstring"#"CTA link URL
ctaVariantButtonVariant"red"CTA button style
ctaSize"sm" | "md" | "lg""md"CTA button size
ctaShape"rounded" | "square""rounded"CTA button shape
ctaBlankboolean-Open CTA link in new tab
variant"blue" | "purple" | "green" | "red" | "neutral" | "outline""neutral"Visual style variant
roundedbooleantrueApply rounded corners to card
hoverAnimationbooleantrueWhether images should scale on card hover
shadowOnHoverbooleantrueWhether card should have shadow on hover
classNamestring""Additional classes

ButtonVariant = "black" | "white" | "red" | "gray" | "lime" | "transparent-black" | "transparent-white" | "transparent-red" | "transparent-gray" | "transparent-lime"

Notes

  • The CTA button is rendered using the library CustomButton with unstyled and className="cta" so the .cta rules from card.css are applied.
  • Variant classes on the root element (blue, purple, etc.) control background and CTA styling via card.css.

Examples

import { Card } from 'landing-page-creator';

<Card
  title="Modern UI Kit"
  description="Build beautiful interfaces faster with our pre-styled components."
  imageSrc="https://picsum.photos/800/450"
  ctaText="Learn More"
  ctaHref="/docs"
  variant="blue"
/>

<Card
  title="Simple Outline"
  description="A minimal outline style card."
  ctaText="Get Started"
  ctaHref="/start"
  variant="outline"
/>

<Card
  title="Not Rounded"
  description="Card with square corners."
  ctaText="View Details"
  ctaHref="/details"
  rounded={false}
  variant="neutral"
/>

// Card with hover effects (default)
<Card
  title="Interactive Card"
  description="Image scales and shadow appears on hover."
  imageSrc="https://picsum.photos/800/450"
  hoverAnimation={true}
  shadowOnHover={true}
/>

// Card without hover effects
<Card
  title="Static Card"
  description="No hover animations."
  hoverAnimation={false}
  shadowOnHover={false}
/>

StickyNav

A sticky navigation component that stays fixed at the top while scrolling. Supports logo/brand, navigation links, CTA button, responsive mobile menu, and scroll-based styling changes.

Props

PropTypeDefaultRequiredDescription
logoUrlstring-Logo image URL
logoAltstring-Logo alt text
brandNamestring-Brand name (used if no logo)
linksNavLink[][]Array of navigation links
ctaTextstring-CTA button text
ctaUrlstring-CTA button URL
ctaVariantButtonVariant"red"CTA button variant
backgroundColorstring"transparent"Background color
scrolledBackgroundColorstring"#ffffff"Background color when scrolled
textColorstring"#111827"Text color
scrolledTextColorstring-Text color when scrolled
showBackgroundOnScrollbooleantrueShow background on scroll
blurOnScrollbooleanfalseApply blur effect on scroll
shadowOnScrollbooleantrueApply shadow on scroll
paddingXstring"1.5rem"Horizontal padding (desktop)
paddingXMobilestring"1rem"Horizontal padding (mobile)
scrollOffsetnumber0Scroll offset before nav becomes sticky (pixels)
stickybooleantrueMake nav sticky/fixed
mobileMenuBackgroundColorstring"#ffffff"Mobile menu background color
mobileMenuTextColorstring"#000000"Mobile menu text color
classNamestring-Additional CSS classes

Interfaces

interface NavLink {
  text: string;
  url: string;
  target?: "_blank" | "_self";
}

ButtonVariant = "black" | "white" | "red" | "gray" | "lime" | "transparent-black" | "transparent-white" | "transparent-red" | "transparent-gray" | "transparent-lime"

Examples

import { StickyNav } from 'landing-page-creator';

// Basic sticky navigation
<StickyNav
  logoUrl="/logo.png"
  brandName="My Brand"
  links={[
    { text: "Home", url: "/" },
    { text: "About", url: "/about" },
    { text: "Services", url: "/services" },
    { text: "Contact", url: "/contact" }
  ]}
  ctaText="Get Started"
  ctaUrl="/signup"
/>

// With scroll-based styling
<StickyNav
  logoUrl="/logo.png"
  brandName="My Brand"
  links={[
    { text: "Home", url: "/" },
    { text: "About", url: "/about" }
  ]}
  backgroundColor="transparent"
  scrolledBackgroundColor="#ffffff"
  textColor="#ffffff"
  scrolledTextColor="#111827"
  shadowOnScroll={true}
  blurOnScroll={false}
/>

// Non-sticky navigation
<StickyNav
  brandName="My Brand"
  links={[
    { text: "Home", url: "/" },
    { text: "About", url: "/about" }
  ]}
  sticky={false}
/>

// With custom mobile menu colors
<StickyNav
  logoUrl="/logo.png"
  brandName="My Brand"
  links={[
    { text: "Home", url: "/" },
    { text: "About", url: "/about" },
    { text: "Services", url: "/services" }
  ]}
  textColor="#ffffff"
  backgroundColor="transparent"
  mobileMenuBackgroundColor="#1a1a1a"
  mobileMenuTextColor="#ffffff"
/>

A comprehensive footer component with brand/logo, multiple link columns, social media links, and copyright information. Fully responsive with mobile-optimized layout.

Props

PropTypeDefaultRequiredDescription
brandNamestring-Company/Brand name
logoUrlstring-Logo image URL
logoAltstring-Logo alt text
descriptionstring-Description text (company mission/about)
columnsFooterColumn[][]Footer columns with links
socialLinksSocialLink[][]Social media links
copyrightstring-Copyright text
backgroundColorstring"#111827"Background color
textColorstring"#ffffff"Text color
linkColorstring-Link color
linkHoverColorstring-Link hover color
classNamestring-Additional CSS classes
childrenReact.ReactNode-Additional content to render at bottom

Interfaces

interface FooterColumn {
  title?: string;
  links: FooterLink[];
}

interface FooterLink {
  text: string;
  url: string;
  target?: "_blank" | "_self";
}

interface SocialLink {
  platform: string;
  url: string;
  icon?: React.ReactNode;
  target?: "_blank" | "_self";
}

Examples

import { Footer } from 'landing-page-creator';

// Basic footer
<Footer
  brandName="My Company"
  logoUrl="/logo.png"
  description="Building amazing products for developers"
  columns={[
    {
      title: "Products",
      links: [
        { text: "Features", url: "/features" },
        { text: "Pricing", url: "/pricing" }
      ]
    },
    {
      title: "Company",
      links: [
        { text: "About", url: "/about" },
        { text: "Contact", url: "/contact" }
      ]
    }
  ]}
  socialLinks={[
    { platform: "Twitter", url: "https://twitter.com/company" },
    { platform: "LinkedIn", url: "https://linkedin.com/company/company" }
  ]}
  copyright="© 2024 My Company. All rights reserved."
/>

// Footer with custom colors
<Footer
  brandName="My Brand"
  logoUrl="/logo.png"
  backgroundColor="#1a1a1a"
  textColor="#ffffff"
  linkColor="#cccccc"
  linkHoverColor="#ffffff"
  columns={[
    {
      title: "Resources",
      links: [
        { text: "Documentation", url: "/docs" },
        { text: "Support", url: "/support" }
      ]
    }
  ]}
  copyright="© 2024 My Brand"
/>

InfoWithImages

A flexible section component that displays text content alongside image collages. Supports 1-3 images arranged in different layouts (single, double, or L-shaped grid), with customizable text positioning, buttons, and styling options.

Props

PropTypeDefaultRequiredDescription
titlestring-Main heading text
eyebrowstring-Eyebrow text displayed above title
paragraphsstring[][]Array of paragraph text to display
primaryButtonButtonConfig-Primary button configuration
secondaryButtonButtonConfig-Secondary button configuration
imagesImageItem[]-Array of 1-3 image items
imagePosition"left" | "right""left"Position of images relative to text
imageRoundedbooleanfalseApply border-radius to images
hoverAnimationbooleantrueWhether images should have hover scale animation. Only the hovered image animates (not all images at once)
backgroundColorstring-Background color
backgroundImagestring-Background image URL
paddingXstring-Horizontal padding (desktop). Accepts any CSS unit (e.g., "2rem", "48px", "5vh"). If not provided, defaults to 0
paddingXMobilestring-Horizontal padding (mobile). Accepts any CSS unit. If not provided, defaults to 0
paddingYstring-Vertical padding (desktop). Accepts any CSS unit. If not provided, defaults to 0
paddingYMobilestring-Vertical padding (mobile). Accepts any CSS unit. If not provided, defaults to 0
paddingTopstring-Top padding (desktop). Accepts any CSS unit. If not provided, falls back to paddingY
paddingTopMobilestring-Top padding (mobile). Accepts any CSS unit. If not provided, falls back to paddingYMobile
paddingBottomstring-Bottom padding (desktop). Accepts any CSS unit. If not provided, falls back to paddingY
paddingBottomMobilestring-Bottom padding (mobile). Accepts any CSS unit. If not provided, falls back to paddingYMobile
classNamestring-Additional CSS classes

Interfaces

interface ImageItem {
  src: string;      // Image source URL
  alt?: string;     // Image alt text
}

interface ButtonConfig {
  text: string;
  url?: string;
  variant?: ButtonVariant;
  size?: "sm" | "md" | "lg";
  shape?: "rounded" | "square";
  blank?: boolean;
  onClick?: () => void;
  className?: string;
}

ButtonVariant = "black" | "white" | "red" | "gray" | "lime" | "transparent-black" | "transparent-white" | "transparent-red" | "transparent-gray" | "transparent-lime"

Image Layouts

  • 1 image: Single full-width image
  • 2 images: Two equal-sized images stacked vertically
  • 3 images: L-shaped grid with one large image and two smaller images

Examples

// Basic usage with single image
<InfoWithImages
  title="Our Story"
  paragraphs={[
    "We started with a simple vision: to make web development easier and more accessible.",
    "Today, we're proud to serve thousands of developers worldwide."
  ]}
  images={[
    { src: "https://example.com/story.jpg", alt: "Our story" }
  ]}
/>

// With eyebrow and buttons
<InfoWithImages
  eyebrow="About Us"
  title="Building the Future"
  paragraphs={[
    "We're creating innovative solutions for modern challenges.",
    "Join us on this journey."
  ]}
  primaryButton={{
    text: "Learn More",
    url: "/about",
    variant: "black"
  }}
  secondaryButton={{
    text: "Contact Us",
    url: "/contact",
    variant: "transparent-black"
  }}
  images={[
    { src: "https://example.com/image1.jpg", alt: "Team photo" },
    { src: "https://example.com/image2.jpg", alt: "Office space" }
  ]}
/>

// Images on the right
<InfoWithImages
  title="Our Services"
  paragraphs={[
    "We offer comprehensive solutions for your business needs."
  ]}
  images={[
    { src: "https://example.com/service1.jpg", alt: "Service 1" },
    { src: "https://example.com/service2.jpg", alt: "Service 2" },
    { src: "https://example.com/service3.jpg", alt: "Service 3" }
  ]}
  imagePosition="right"
/>

// With rounded images and custom background
<InfoWithImages
  eyebrow="Innovation"
  title="Creative Solutions"
  paragraphs={[
    "We combine creativity with technology to deliver exceptional results."
  ]}
  images={[
    { src: "https://example.com/creative.jpg", alt: "Creative work" }
  ]}
  imageRounded={true}
  hoverAnimation={true}
  backgroundColor="#f5f5f5"
  primaryButton={{
    text: "View Portfolio",
    url: "/portfolio",
    variant: "red"
  }}
/>

// With hover animation disabled
<InfoWithImages
  title="Static Images"
  paragraphs={["No hover effects on images"]}
  images={[{ src: "image.jpg", alt: "Image" }]}
  hoverAnimation={false}
/>

// Three images with L-shaped layout
<InfoWithImages
  title="Our Workspace"
  paragraphs={[
    "A modern environment designed for collaboration and innovation."
  ]}
  images={[
    { src: "https://example.com/workspace1.jpg", alt: "Workspace 1" },
    { src: "https://example.com/workspace2.jpg", alt: "Workspace 2" },
    { src: "https://example.com/workspace3.jpg", alt: "Workspace 3" }
  ]}
/>

ImageCardGrid

A flexible image card grid component that displays items in either a grid or carousel layout. Perfect for showcasing products, services, or portfolio items with images, titles, and descriptions.

Props

PropTypeDefaultRequiredDescription
titlestring-Section title
subtitlestring-Section subtitle
itemsCardItem[]-Array of card items to display
layout"grid" | "carousel""grid"Layout type - grid or carousel
imageHeightstring"300px"Height of images (accepts any CSS unit)
hoverAnimationbooleantrueWhether images should have hover scale animation
backgroundColorstring-Background color
backgroundImagestring-Background image URL
paddingXstring-Horizontal padding (desktop). Accepts any CSS unit. If not provided, defaults to 0
paddingXMobilestring-Horizontal padding (mobile). Accepts any CSS unit. If not provided, defaults to 0
paddingYstring-Vertical padding (desktop). Accepts any CSS unit. If not provided, defaults to 0
paddingYMobilestring-Vertical padding (mobile). Accepts any CSS unit. If not provided, defaults to 0
paddingTopstring-Top padding (desktop). Accepts any CSS unit. If not provided, falls back to paddingY
paddingTopMobilestring-Top padding (mobile). Accepts any CSS unit. If not provided, falls back to paddingYMobile
paddingBottomstring-Bottom padding (desktop). Accepts any CSS unit. If not provided, falls back to paddingY
paddingBottomMobilestring-Bottom padding (mobile). Accepts any CSS unit. If not provided, falls back to paddingYMobile
classNamestring-Additional CSS classes

CardItem Interface

interface CardItem {
  image: string;        // Image source URL
  imageAlt?: string;     // Image alt text
  title: string;         // Card title
  description?: string;  // Card description
}

Examples

// Basic grid layout
<ImageCardGrid
  title="Our Products"
  subtitle="Featured Items"
  items={[
    {
      image: "https://example.com/product1.jpg",
      imageAlt: "Product 1",
      title: "Product 1",
      description: "Description of product 1"
    },
    {
      image: "https://example.com/product2.jpg",
      imageAlt: "Product 2",
      title: "Product 2",
      description: "Description of product 2"
    },
    {
      image: "https://example.com/product3.jpg",
      imageAlt: "Product 3",
      title: "Product 3",
      description: "Description of product 3"
    }
  ]}
/>

// Carousel layout
<ImageCardGrid
  title="Featured Items"
  items={[
    { image: "item1.jpg", title: "Item 1" },
    { image: "item2.jpg", title: "Item 2" },
    { image: "item3.jpg", title: "Item 3" }
  ]}
  layout="carousel"
/>

// With custom image height and hover animation
<ImageCardGrid
  title="Portfolio"
  items={[
    { image: "work1.jpg", title: "Work 1", description: "Description" },
    { image: "work2.jpg", title: "Work 2", description: "Description" }
  ]}
  imageHeight="400px"
  hoverAnimation={true}
/>

// With background and padding
<ImageCardGrid
  title="Our Services"
  items={[
    { image: "service1.jpg", title: "Service 1" },
    { image: "service2.jpg", title: "Service 2" }
  ]}
  backgroundColor="#f5f5f5"
  paddingX="2rem"
  paddingY="3rem"
/>

// Without hover animation
<ImageCardGrid
  title="Static Grid"
  items={[
    { image: "item1.jpg", title: "Item 1" }
  ]}
  hoverAnimation={false}
/>

AlternatingContentSection

A content section component that displays items in an alternating layout with images or icons on one side and text content on the other. Perfect for feature lists, process steps, or content showcases.

Props

PropTypeDefaultRequiredDescription
titlestring-Section title
subtitlestring-Section subtitle
itemsContentItem[]-Array of content items
imagePosition"left" | "right""left"Starting position for images (alternates automatically)
imageRoundedbooleanfalseApply border-radius to images
hoverAnimationbooleantrueWhether images should have hover scale animation
backgroundColorstring-Background color
backgroundImagestring-Background image URL
paddingXstring-Horizontal padding (desktop). Accepts any CSS unit. If not provided, defaults to 0
paddingXMobilestring-Horizontal padding (mobile). Accepts any CSS unit. If not provided, defaults to 0
paddingYstring-Vertical padding (desktop). Accepts any CSS unit. If not provided, defaults to 0
paddingYMobilestring-Vertical padding (mobile). Accepts any CSS unit. If not provided, defaults to 0
paddingTopstring-Top padding (desktop). Accepts any CSS unit. If not provided, falls back to paddingY
paddingTopMobilestring-Top padding (mobile). Accepts any CSS unit. If not provided, falls back to paddingYMobile
paddingBottomstring-Bottom padding (desktop). Accepts any CSS unit. If not provided, falls back to paddingY
paddingBottomMobilestring-Bottom padding (mobile). Accepts any CSS unit. If not provided, falls back to paddingYMobile
classNamestring-Additional CSS classes

ContentItem Interface

interface ContentItem {
  icon?: React.ReactNode;  // Optional icon element
  title: string;            // Item title
  description: string;      // Item description
  image?: string;           // Optional image URL
  imageAlt?: string;        // Image alt text
}

Examples

// Basic alternating content with images
<AlternatingContentSection
  title="Our Features"
  backgroundColor="#f5f5f5"
  items={items}
/>

Form

A fully featured form builder that integrates tightly with Formik and Yup. Define fields declaratively, enable inline validation with Yup rules, render optional imagery, and control layout/padding without writing custom form logic.

Key Features

  • Declarative fields array with inline validation (auto-generated Yup schema)
  • Optional title, description, background image/color, and side imagery
  • Responsive padding controls for the entire section and for the form content only
  • Built‑in submit button with variant/size options or supply your own renderer
  • Supports custom field renderers and layouts (vertical or horizontal)
  • Includes a dedicated phone field type that renders the new PhoneInput with flags

Top-Level Props

PropTypeDefaultRequiredDescription
initialValuesT-Initial Formik values
fieldsFormFieldConfig[]-Declarative field definitions (see below)
onSubmit(values: T, helpers) => void-Submit handler
validationSchemaYup.ObjectSchemaAuto-builtProvide custom schema or let the component build one from field validation
title / descriptionstring-Optional section heading copy
imagestring-Optional imagery to render beside the form
imagePosition"left" | "right""left"Image alignment
imageRoundedbooleantrueToggle image corner rounding
layout"vertical" | "horizontal""vertical"Field layout
backgroundColor / backgroundImagestring-Section background styling
paddingX, paddingY, paddingTop, paddingBottom (+ Mobile variations)string0Section padding controls
contentPaddingX, contentPaddingY, contentPaddingTop, contentPaddingBottom (+ Mobile variations)string0Padding applied only to the form content (title/description/inputs)
renderSubmitButton(ctx) => ReactNodeInternal buttonReplace the default submit button
renderField(field, formik) => ReactNode-Custom rendering hook per field
showLabelsbooleantrueToggle automatic <label> rendering

FormFieldConfig

Field PropertyTypeDefaultDescription
namestring-Formik field name (required)
type"text" | "email" | "password" | "number" | "tel" | "url" | "textarea" | "select" | "checkbox" | "radio" | "date" | "file" | "phone""text"Field type
labelstring-Field label text
requiredbooleanfalseMark field as required
requiredMessagestring-Custom required error message
validationValidationRules-Inline validation { min, max, pattern, validate, message }
placeholderstring-Field placeholder text
helperTextstring-Additional helper copy beneath the field
options`{ label: string; value: stringnumber }[]`-
rowsnumber4Textarea rows
multiplebooleanfalseEnable multi-select (select/file)
acceptstring-Accepted file types (file input)
disabledbooleanfalseDisable the field
classNamestring-Additional classes for the field container
defaultCountrystring-ISO country code for phone type (e.g., "US")

ValidationRules support the following keys: min, max, pattern, patternMessage, validate, and message (error override).

Examples

import { Form } from 'landing-page-creator';

function ContactForm() {
  return (
    <Form
      initialValues={{ name: '', email: '', phone: '', message: '' }}
      fields={[
        { name: 'name', label: 'Full Name', required: true, validation: { min: 2 } },
        { name: 'email', label: 'Email Address', type: 'email', required: true, validation: { email: true, message: 'Invalid email address' } },
        { name: 'phone', label: 'Phone Number', type: 'phone', defaultCountry: 'US', validation: { required: true } },
        { name: 'message', label: 'How can we help?', type: 'textarea', rows: 4, validation: { min: 10, message: 'Too Short!' } },
      ]}
      onSubmit={(values, helpers) => {
        console.log(values);
        // Formik helpers.setTouched({}); // Mark all fields as touched
        // helpers.setErrors({}); // Clear all errors
      }}
      title="Contact Us"
      description="We'd love to hear from you!"
      image="https://picsum.photos/600/400"
      imagePosition="right"
      layout="horizontal"
      showLabels={false}
      renderSubmitButton={(ctx) => (
        <CustomButton
          variant="black"
          text="Send Message"
          size="lg"
          onClick={ctx.handleSubmit}
          disabled={ctx.isSubmitting}
        />
      )}
    />
  );
}

A powerful carousel/slider component built with Swiper. Features thumbnail navigation, fullscreen mode, autoplay, and responsive breakpoints. Perfect for displaying images, videos, or any content in a rotating carousel format.

Props

PropTypeDefaultRequiredDescription
childrenReact.ReactNode[]-Array of slide content (images, videos, etc.)
autoplayboolean | numberfalseEnable autoplay (true for default delay, or number for custom delay in ms)
showThumbnailsbooleantrueShow thumbnail navigation below main carousel
showArrowsbooleantrueShow navigation arrows
showPaginationbooleantrueShow pagination dots
delaynumber3000Autoplay delay in milliseconds
pauseOnHoverbooleanfalsePause autoplay on hover
loopbooleantrueEnable infinite loop
spaceBetweennumber30Space between slides in pixels
slidesPerViewnumber | 'auto'1Number of slides visible at once
slidesPerViewMobilenumber | 'auto'1Slides per view on mobile
slidesPerViewDesktopnumber | 'auto'1Slides per view on desktop
heightnumber | string-Carousel height (px or CSS value)
heightMobilenumber | string-Height on mobile devices
heightDesktopnumber | string-Height on desktop devices
aspectRationumber | string-Aspect ratio (e.g., '16/9' or 1.777)
activeColorstring'#007bff'Color for active pagination dot and thumbnail border
classNamestring-Additional CSS classes
enableFullscreenbooleanfalseEnable fullscreen modal view

Examples

// Basic carousel
<Carousel>
  <img src="image1.jpg" alt="Image 1" />
  <img src="image2.jpg" alt="Image 2" />
  <img src="image3.jpg" alt="Image 3" />
</Carousel>

// With autoplay
<Carousel
  autoplay={3000}
  loop={true}
>
  <img src="image1.jpg" alt="Image 1" />
  <img src="image2.jpg" alt="Image 2" />
  <img src="image3.jpg" alt="Image 3" />
</Carousel>

// Without thumbnails
<Carousel
  showThumbnails={false}
  showArrows={true}
  showPagination={true}
>
  <img src="image1.jpg" alt="Image 1" />
  <img src="image2.jpg" alt="Image 2" />
</Carousel>

// Custom height with aspect ratio
<Carousel
  height={500}
  aspectRatio="16/9"
  autoplay={3000}
>
  <img src="image1.jpg" alt="Image 1" />
  <img src="image2.jpg" alt="Image 2" />
</Carousel>

// Responsive carousel with different views
<Carousel
  slidesPerViewMobile={1}
  slidesPerViewDesktop={3}
  spaceBetween={20}
>
  <img src="image1.jpg" alt="Image 1" />
  <img src="image2.jpg" alt="Image 2" />
  <img src="image3.jpg" alt="Image 3" />
</Carousel>

// With fullscreen mode
<Carousel
  enableFullscreen={true}
  activeColor="#ff0000"
>
  <img src="image1.jpg" alt="Image 1" />
  <img src="image2.jpg" alt="Image 2" />
  <img src="image3.jpg" alt="Image 3" />
</Carousel>

// Pause on hover
<Carousel
  autoplay={3000}
  pauseOnHover={true}
  loop={true}
>
  <img src="image1.jpg" alt="Image 1" />
  <img src="image2.jpg" alt="Image 2" />
</Carousel>

// Custom styling
<Carousel
  className="my-custom-carousel"
  activeColor="#00ff00"
  heightMobile="200px"
  heightDesktop="600px"
>
  <img src="image1.jpg" alt="Image 1" />
  <img src="image2.jpg" alt="Image 2" />
</Carousel>

SectionsRenderer

A utility component that renders multiple sections in a declarative way. Perfect for building complete landing pages with a consistent structure.

Props

PropTypeDefaultRequiredDescription
sectionsSectionConfig[]-Array of section configurations

Section Configuration

Each section in the sections array must have:

  • type: The type of section ("hero", "stats-grid", "overview", "info-with-images", "image-card-grid", "alternating-content", "footer", or "sticky-nav")
  • content: The props for that section
type SectionConfig = 
  | { type: "hero"; content: HeroProps }
  | { type: "stats-grid"; content: StatsGridProps }
  | { type: "overview"; content: OverviewProps }
  | { type: "info-with-images"; content: InfoWithImagesProps }
  | { type: "image-card-grid"; content: ImageCardGridProps }
  | { type: "alternating-content"; content: AlternatingContentSectionProps }
  | { type: "footer"; content: FooterProps }
  | { type: "sticky-nav"; content: StickyNavProps };

Note: Carousel is a standalone component and is not part of SectionsRenderer. Import and use it directly in your components.

Examples

import { SectionsRenderer } from 'landing-page-creator';

function LandingPage() {
  const sections = [
    {
      type: "sticky-nav" as const,
      content: {
        logoUrl: "/logo.png",
        brandName: "My Brand",
        links: [
          { text: "Home", url: "/" },
          { text: "About", url: "/about" },
          { text: "Services", url: "/services" },
          { text: "Contact", url: "/contact" }
        ],
        ctaText: "Get Started",
        ctaUrl: "/signup"
      }
    },
    {
      type: "hero" as const,
      content: {
        title: "Welcome to Our Platform",
        subtitle: "The Future of Web Development",
        description: "Build stunning landing pages with ease",
        primaryButtonText: "Get Started",
        primaryButtonUrl: "/signup",
        backgroundImage: "https://example.com/hero.jpg",
        overlayOpacity: 0.3
      }
    },
    {
      type: "stats-grid" as const,
      content: {
        stats: [
          { label: "Happy Customers", value: "10K", unit: "+" },
          { label: "Projects Completed", value: "500" },
          { label: "Team Members", value: "50", unit: "+" },
          { label: "Years of Experience", value: "10", unit: "+" }
        ],
        columns: 4,
        showHover: true
      }
    },
    {
      type: "overview" as const,
      content: {
        title: "About Our Project",
        subtitle: "Innovation",
        description: "This is an amazing project that solves real-world problems.",
        highlights: [
          { label: "Feature 1", value: "Value 1" },
          { label: "Feature 2", value: "Value 2" },
          { label: "Feature 3", value: "Value 3" }
        ],
        media: {
          type: "image",
          src: "https://example.com/image.jpg",
          alt: "Project image"
        }
      }
    },
    {
      type: "info-with-images" as const,
      content: {
        title: "Our Story",
        eyebrow: "About Us",
        paragraphs: [
          "We started with a vision to make web development easier.",
          "Today, we serve thousands of developers worldwide."
        ],
        images: [
          { src: "https://example.com/story.jpg", alt: "Our story" }
        ],
        primaryButton: {
          text: "Learn More",
          url: "/about",
          variant: "black"
        }
      }
    },
    {
      type: "image-card-grid" as const,
      content: {
        title: "Our Products",
        subtitle: "Featured Items",
        items: [
          {
            image: "https://example.com/product1.jpg",
            imageAlt: "Product 1",
            title: "Product 1",
            description: "Description of product 1"
          },
          {
            image: "https://example.com/product2.jpg",
            imageAlt: "Product 2",
            title: "Product 2",
            description: "Description of product 2"
          }
        ],
        layout: "grid",
        hoverAnimation: true
      }
    },
    {
      type: "alternating-content" as const,
      content: {
        title: "Our Features",
        subtitle: "Why Choose Us",
        items: [
          {
            image: "https://example.com/feature1.jpg",
            imageAlt: "Feature 1",
            title: "Feature 1",
            description: "Description of feature 1"
          },
          {
            image: "https://example.com/feature2.jpg",
            imageAlt: "Feature 2",
            title: "Feature 2",
            description: "Description of feature 2"
          }
        ],
        imagePosition: "left",
        hoverAnimation: true
      }
    },
    {
      type: "footer" as const,
      content: {
        brandName: "My Company",
        logoUrl: "/logo.png",
        description: "Building amazing products for developers",
        columns: [
          {
            title: "Products",
            links: [
              { text: "Features", url: "/features" },
              { text: "Pricing", url: "/pricing" }
            ]
          },
          {
            title: "Company",
            links: [
              { text: "About", url: "/about" },
              { text: "Contact", url: "/contact" }
            ]
          }
        ],
        socialLinks: [
          { platform: "Twitter", url: "https://twitter.com/company" },
          { platform: "LinkedIn", url: "https://linkedin.com/company/company" }
        ],
        copyright: "© 2024 My Company. All rights reserved."
      }
    }
  ];

  return <SectionsRenderer sections={sections} />;
}

PhoneInput

The PhoneInput component powers the type: "phone" field inside the Form component, and can also be used standalone. It provides an international phone number input complete with a country code selector and flag icons sourced from a lightweight CDN.

Props

PropTypeDefaultRequiredDescription
namestring-Formik field name
labelstring-Field label
placeholderstring-Input placeholder
helperTextstring-Helper text below the field
classNamestring-Wrapper class override
requiredbooleanfalseMark as required
disabledbooleanfalseDisable the control
showErrorbooleantrueToggle error message display
defaultCountrystring"US"ISO country code used for initial flag/dial code

Usage

import { PhoneInput } from 'landing-page-creator';

function StandalonePhoneField() {
  return (
    <Formik initialValues={{ phone: '' }} onSubmit={(values) => console.log(values)}>
      <Form>
        <PhoneInput
          name="phone"
          label="Phone Number"
          defaultCountry="GB"
          helperText="We will only use this to call you about your booking."
        />
      </Form>
    </Formik>
  );
}

Using inside the declarative Form component

fields={[
  { name: 'phone', label: 'Phone Number', type: 'phone', defaultCountry: 'CA' },
]}

The control automatically formats the stored value as "+XX 123456789" and keeps the selected country flag in sync with the dial code.

License

MIT © Mohamed Abdelkarim

Keywords

react

FAQs

Package last updated on 10 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts