Skip to main content
Version: 1.0.3

SignIn

Overview

The SignIn component provides a complete, production-ready authentication form with support for multiple layouts, themes, social login options, and extensive customization capabilities. It's designed to be flexible, accessible, and easy to integrate into any React application.

Key Features

  • Multiple Layouts: Centered and split layout options
  • Visual Themes: Default, modern, glass, and dark variants
  • Social Login: Google, GitHub, and Microsoft integration
  • Customizable Content: Complete control over left panel content in split layout
  • Accessibility: Built with ARIA labels and keyboard navigation
  • Responsive: Works on all screen sizes
  • Animations: Smooth transitions with Framer Motion
  • Validation: Built-in form validation

Installation

ignix add component signin

Previews

1. Centered Dark Layout

Elegant dark theme with centered form layout, perfect for minimalist designs and dark mode applications.

Sign In to Your Account

Welcome back! Please enter your details to continue

Or continue with

Don't have an account?

2. Split Dark Layout

Professional split layout with extensive left panel customization, ideal for enterprise applications and security-focused platforms.

Sign In to Your Account

Welcome back! Please enter your details to continue

Or continue with

Don't have an account?

Quick Start

Import the component and start using it:


import { SignIn } from '@site/src/components/UI/sign-in';

function LoginPage() {
const handleSubmit = async (data) => {
console.log('User data:', data);
// Your authentication logic here
};

return (
<SignIn
type="centered"
variant="dark"
companyName="MyApp"
onSubmit={handleSubmit}
showSocialLogin={true}
/>
);
}

Usage Examples

Form Handling with Validation

import React, { useState } from 'react';
import { SignIn } from '@site/src/components/UI/sign-in';

function ControlledSignIn() {
const [loading, setLoading] = useState(false);
const [error, setError] = useState('');

const handleSubmit = async (data) => {
setLoading(true);
setError('');

try {
// Your API call here
const response = await fetch('/api/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
});

if (!response.ok) {
throw new Error('Login failed');
}

// Handle successful login
console.log('Login successful:', data);
} catch (error) {
setError('Invalid credentials. Please try again.');
} finally {
setLoading(false);
}
};

return (
<SignIn
onSubmit={handleSubmit}
loading={loading}
error={error}
type="centered"
variant="default"
companyName="MyApp"
/>
);
}

Social Login Integration

import React from 'react';
import { SignIn } from '@site/src/components/UI/sign-in';

function SocialSignIn() {
const handleGoogleSignIn = async () => {
// Implement Google OAuth
window.location.href = '/api/auth/google';
};

const handleGitHubSignIn = async () => {
// Implement GitHub OAuth
window.location.href = '/api/auth/github';
};

return (
<SignIn
type="centered"
variant="modern"
companyName="SocialApp"
showSocialLogin={true}
onGoogleSignIn={handleGoogleSignIn}
onGitHubSignIn={handleGitHubSignIn}
onMicrosoftSignIn={() => console.log('Microsoft sign-in')}
/>
);
}

Advanced Customization

Left Panel Content Customization (Split Layout Only)

The SignIn component allows extensive customization of the left panel content in split layout:

<SignIn
type="split"
variant="modern"
companyName="CustomApp"
leftPanelContent={{
// Custom title (can be string or React node)
title: (
<div className="space-y-2">
<div className="text-4xl font-bold">Welcome Back</div>
<div className="text-3xl font-bold text-blue-400">to CustomApp</div>
</div>
),

// Custom description
description: "Experience the future of productivity with AI-powered tools and seamless collaboration.",

// Custom subtitle
subtitle: "Join 10,000+ innovative teams",

// Custom features list
features: [
{
text: "AI-powered insights & automation",
icon: <Zap className="w-5 h-5" />,
iconColor: "text-yellow-400",
textClassName: "font-bold text-white",
},
{
text: "Real-time team collaboration",
icon: <Users className="w-5 h-5" />,
iconColor: "text-green-400",
textClassName: "font-bold text-white",
},
{
text: "Enterprise-grade security",
icon: <Shield className="w-5 h-5" />,
iconColor: "text-blue-400",
textClassName: "font-bold text-white",
},
],

// Statistics display
statistics: [
{
value: "10K+",
label: "Teams",
subtext: "Worldwide",
},
{
value: "40%",
label: "Faster",
subtext: "Productivity gain",
},
{
value: "99.9%",
label: "Uptime",
subtext: "Guaranteed SLA",
},
],

// Customer testimonials
testimonials: [
{
quote: "This platform transformed how our team works. We're shipping features 2x faster!",
author: "Alex Chen",
role: "CTO, TechStartup",
},
{
quote: "The AI insights have helped us identify bottlenecks we never knew existed.",
author: "Maria Rodriguez",
role: "Product Lead, GrowthLabs",
},
],

// Custom footer text
footerText: (
<div className="text-sm">
<span className="font-bold">© 2024 CustomApp</span>
<span className="opacity-70 ml-2">• All rights reserved • ISO 27001 Certified</span>
</div>
),

// Layout options
layout: {
align: "left", // "left" | "center" | "right"
maxWidth: "max-w-lg",
animate: true,
},

// Animation configuration
animationConfig: {
titleDelay: 0.2,
descriptionDelay: 0.3,
featuresDelay: 0.4,
staggerChildren: 0.1,
},
}}
splitBackground={{
gradient: "bg-gradient-to-br from-gray-900 via-gray-800 to-gray-900",
textColor: "text-white",
}}
onSubmit={handleSubmit}
/>

Complete Custom Content Example

<SignIn
type="split"
variant="dark"
companyName="InnovateCorp"
leftPanelContent={{
hideBranding: false,
customContent: (
<div className="w-full h-full flex flex-col items-center justify-center p-12">
<div className="text-center space-y-8">
<div className="space-y-4">
<div className="text-6xl font-bold bg-gradient-to-r from-cyan-400 to-blue-500 bg-clip-text
text-transparent">
Welcome Back
</div>
<div className="text-2xl text-gray-300">
To the Future of Work
</div>
</div>

<div className="max-w-lg mx-auto space-y-6">
<div className="text-lg text-gray-400">
Experience the next generation of team collaboration.
Powered by AI and designed for humans.
</div>

<div className="grid grid-cols-2 gap-6 pt-8">
<div className="bg-white/5 p-4 rounded-lg backdrop-blur-sm">
<div className="text-3xl font-bold text-cyan-400">10x</div>
<div className="text-sm text-gray-400">Faster Onboarding</div>
</div>
<div className="bg-white/5 p-4 rounded-lg backdrop-blur-sm">
<div className="text-3xl font-bold text-blue-400">24/7</div>
<div className="text-sm text-gray-400">AI Assistance</div>
</div>
</div>
</div>
</div>
</div>
),
}}
splitBackground={{
gradient: "bg-gradient-to-br from-gray-900 via-gray-800 to-gray-900",
}}
onSubmit={handleSubmit}
/>

Props

Basic Props

PropTypeDefaultDescription
type'centered' | 'split''centered'Layout type - centered or split layout
variant'default' | 'modern' | 'glass' | 'dark''default'Visual theme variant for the form
companyNamestring'YourBrand'Company/brand name displayed in split layout
logoReact.ReactNode-Custom logo component
loadingbooleanfalseLoading state for form submission
errorstring''Error message to display above the form
showSocialLoginbooleantrueShow/hide social login buttons
showForgotPasswordbooleantrueShow/hide forgot password link
showSignUpLinkbooleantrueShow/hide sign up link
onSubmit(data: SignInFormData) => void-Callback function when form is submitted
onSignUp() => void-Callback function when user clicks sign-up link
onGoogleSignIn() => void-Callback function for Google sign-in
onGitHubSignIn() => void-Callback function for GitHub sign-in
onMicrosoftSignIn() => void-Callback function for Microsoft sign-in
classNamestring-Additional className for the component

Split Background Props

PropTypeDefaultDescription
splitBackground.gradientstring-Background gradient classes for left panel
splitBackground.textColorstring-Text color for left panel
splitBackground.companyNameColorstring-Override company name color
splitBackground.descriptionColorstring-Override description color
splitBackground.leftPanelClassNamestring-Custom left panel className
splitBackground.backgroundImagestring-Background image URL
splitBackground.overlayColorstring-Overlay color for background image
splitBackground.rightPanelClassNamestring-Custom right panel className

Button Style Props

PropTypeDefaultDescription
buttonStyle.gradientstring-Background gradient classes for sign in button
buttonStyle.hoverGradientstring-Hover gradient classes for sign in button
buttonStyle.textColorstring-Text color for sign in button
buttonStyle.shadowstring-Button shadow classes
buttonStyle.hoverShadowstring-Hover shadow classes
buttonStyle.classNamestring-Custom button className

Left Panel Content Props (Split Layout Only)

PropTypeDefaultDescription
leftPanelContent.titlestring | React.ReactNode-Custom title text or component
leftPanelContent.descriptionstring | React.ReactNode-Custom description text or component
leftPanelContent.subtitlestring | React.ReactNode-Custom subtitle text or component
leftPanelContent.featuresArray<Feature>-Features/benefits list with icons and colors
leftPanelContent.testimonialsArray<Testimonial>-Customer testimonials/quotes
leftPanelContent.statisticsArray<Statistic>-Statistics to display with values and labels
leftPanelContent.customContentReact.ReactNode-Complete custom content (overrides all other content)
leftPanelContent.footerTextstring | React.ReactNode-Custom footer text or component
leftPanelContent.hideBrandingboolean-Hide default logo and company name
leftPanelContent.contentClassNamestring-Additional className for content container
leftPanelContent.layoutObject-Layout options (align, maxWidth, animate)
leftPanelContent.animationConfigObject-Animation timing configuration