Tripura - Travel & Tour Next.js Template v0.1.0

Tripura Documentation

A modern travel and tour booking website built with Next.js 16, React 19, and Tailwind CSS 4. Tripura showcases travel destinations, tour packages, and blog content with smooth scroll-triggered animations and a fully responsive design.

Next.js 16.1.6 React 19.2.3 TypeScript 5 Tailwind CSS 4 Framer Motion 12 Swiper 11

Tech Stack

▲
Next.js 16
App Router, static prerendering, Turbopack dev server.
⚛
React 19
Latest React with client components and hooks.
🎨
Tailwind CSS 4
Utility-first styling with default breakpoints and custom container.
✦
Framer Motion
Scroll-triggered fade animations via the FadeIn component.
⟳
Swiper 11
Touch-friendly carousels with fade, pagination, and autoplay.
TS
TypeScript 5
Strict mode with path aliases (@/* → src/*).
PackageVersionPurpose
next16.1.6React framework with App Router
react19.2.3UI library
tailwindcss4.xUtility-first CSS
framer-motion12.35.0Animation library
swiper11.2.10Carousel / slider
nouislider15.8.1Price range slider
@fortawesome/fontawesome-free7.2.0Icon library

Getting Started

Prerequisites

Install & Run

# Clone the repository
git clone <repository-url>
cd tripura-nextjs

# Install dependencies
npm install

# Start development server (Turbopack)
npm run dev

# Build for production
npm run build

# Start production server
npm start

Open http://localhost:3000 in your browser.

Available Scripts

ScriptCommandDescription
devnext devStart dev server with Turbopack
buildnext buildProduction build (static prerender)
startnext startServe production build
linteslintRun ESLint with Next.js rules

Project Structure

tripura-nextjs/
├── package.json
├── next.config.ts          # Next.js configuration
├── tsconfig.json           # TypeScript config (strict, @/* alias)
├── postcss.config.mjs      # PostCSS → @tailwindcss/postcss
├── eslint.config.mjs       # ESLint + Next.js core web vitals
│
├── src/
│   ├── app/                  # App Router pages
│   │   ├── layout.tsx        # Root layout (fonts, vendor CSS, metadata)
│   │   ├── globals.css       # Tailwind import + custom utilities
│   │   ├── page.tsx          # Home page
│   │   ├── about/
│   │   ├── contact/
│   │   ├── destinations/
│   │   ├── destinations-details/
│   │   ├── home-two/
│   │   ├── news/
│   │   ├── news-details/
│   │   ├── tour-details/
│   │   ├── tours/
│   │   └── tours-list/
│   │
│   ├── components/           # Reusable UI components
│   │   ├── ClientLayout.tsx  # Page wrapper (header, footer, hooks)
│   │   ├── Header.tsx        # Desktop navigation
│   │   ├── MobileNav.tsx     # Mobile drawer navigation
│   │   ├── Footer.tsx        # Site footer
│   │   ├── FadeIn.tsx        # Framer Motion scroll animation
│   │   ├── Preloader.tsx     # Loading spinner
│   │   ├── BackToTop.tsx     # Scroll-to-top button
│   │   ├── SearchPopup.tsx   # Search modal
│   │   └── PageBanner.tsx    # Page header with breadcrumb
│   │
│   └── hooks/                # Custom React hooks
│       ├── useAnimations.ts  # Counter & progress bar animations
│       ├── useSwiperInit.ts  # Swiper carousel initializer
│       └── useUIPlugins.ts   # Sticky header, accordion, popups, slider
│
└── public/
    └── assets/
        ├── css/              # Template CSS
        │   ├── tripura.css
        │   └── tripura-responsive.css
        ├── images/           # Static images
        └── vendors/          # Third-party CSS (FontAwesome, Swiper, etc.)

Configuration

TypeScript — tsconfig.json

Strict mode is enabled. The @/* path alias maps to ./src/* for clean imports.

{
  "compilerOptions": {
    "target": "ES2017",
    "strict": true,
    "jsx": "react-jsx",
    "moduleResolution": "bundler",
    "paths": { "@/*": ["./src/*"] }
  }
}

PostCSS — postcss.config.mjs

Uses @tailwindcss/postcss as the only plugin — Tailwind CSS v4 style.

const config = {
  plugins: {
    "@tailwindcss/postcss": {},
  },
};
export default config;

ESLint — eslint.config.mjs

Next.js core web vitals and TypeScript rules. Ignores build output directories (.next, out, build).

Styling

CSS Architecture

Styling is organized in three layers:

LayerFile(s)Description
Tailwind globals.css Tailwind CSS v4 import, custom container, utility classes
Template tripura.css, tripura-responsive.css Template-specific styles, component classes, responsive overrides
Vendor public/assets/vendors/ Third-party CSS (FontAwesome, Swiper, noUiSlider, Jarallax, etc.)

Global CSS Utilities

/* globals.css */
@import "tailwindcss";

@layer base {
  .container {
    margin-inline: auto;
    padding-inline: 15px;
  }
}

@utility list-unstyled {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

@utility clearfix {
  &::after {
    content: "";
    display: table;
    clear: both;
  }
}

Tailwind Breakpoints

Default Tailwind CSS v4 breakpoints are used throughout the project:

PrefixMin-widthUsage
sm640pxSmall devices
md768pxTablets
lg1024pxLaptops
xl1280pxDesktops
2xl1536pxLarge screens

Pages & Routes

All pages live under src/app/ using the Next.js App Router convention. Each page wraps its content in <ClientLayout> for the shared header, footer, and client-side functionality. All 11 routes are statically prerendered at build time.

RouteFileDescription
/src/app/page.tsxHome — hero carousel with star rating, tour search form
/home-twosrc/app/home-two/page.tsxAlternate home with background slideshow, 6 tour cards
/aboutsrc/app/about/page.tsxAbout the company
/destinationssrc/app/destinations/page.tsxDestinations in masonry grid layout
/destinations-detailssrc/app/destinations-details/page.tsxIndividual destination with gallery
/tourssrc/app/tours/page.tsxFeatured tour packages — grid view
/tours-listsrc/app/tours-list/page.tsxTour packages — list view with sidebar filters
/tour-detailssrc/app/tour-details/page.tsxTour detail with image slider, accordion, booking
/newssrc/app/news/page.tsxBlog / travel stories listing
/news-detailssrc/app/news-details/page.tsxIndividual article with two-column layout
/contactsrc/app/contact/page.tsxContact form with details

Home Page — /

Main landing page featuring a Swiper hero carousel (3 slides) with 4.6-star rating display and call-to-action buttons. Below the slider is a tour search form with destination and date filters, animated into view with the FadeIn component.

Home Two — /home-two

Alternate landing with a Vegas background slideshow (rotating background images) and a tour search CTA. Displays 6 tour cards with pricing, duration, and feature lists. Each card uses staggered FadeIn animations.

About — /about

Company information page with a hero banner, breadcrumb navigation, and content sections. Uses the standard page header pattern with background image.

Destinations — /destinations, /destinations-details

Destinations displays locations in a masonry grid layout with varied card sizes. Destination Details shows an individual location with an image gallery, description, and two-column layout (8/12 content + 4/12 sidebar).

Tours — /tours, /tours-list, /tour-details

Tours shows packages in a responsive grid (3 cols on xl, 2 on md). Tours List offers a list view with a sidebar containing a price range slider (noUiSlider). Tour Details has an image slider (Swiper with fade + pagination), FAQ accordion, and booking form.

News — /news, /news-details

News lists 6 articles with staggered fade-in animations. Topics include travel stories and destination guides. News Details shows a full article in a two-column layout.

Contact — /contact

Contact page with a form (left column) and contact details. Uses responsive flex grid layout.

Components

ClientLayout

src/components/ClientLayout.tsx "use client"

Purpose

Top-level wrapper for all pages. Renders the full page shell (preloader, header, footer, mobile nav, search popup, back-to-top) and initializes all client-side hooks.

Props

PropTypeDescription
childrenReactNodePage content rendered between header and footer

Hooks Initialized

  • useAnimations() — counter & progress bar animations
  • useSwiperInit() — auto-initialize Swiper carousels
  • useUIPlugins() — sticky header, accordion, popups, slider

Render Tree

<Preloader />
<div.announcement-bar>
<div.page-wrapper>
  <Header />
  {children}
  <Footer />
</div>
<MobileNav />
<SearchPopup />
<BackToTop />

Header

src/components/Header.tsx "use client"

Purpose

Desktop navigation bar with logo, dropdown menus, and route-aware active states.

Props

PropTypeDescription
onMobileNavToggle() => voidCallback to open mobile navigation drawer

Navigation Items

Defined as a navItems array with the following structure:

MenuChildren
HomeHome One (/), Home Two (/home-two)
DestinationsDestinations (/destinations), Destination Details (/destinations-details)
ToursTours (/tours), Tours List (/tours-list), Tour Details (/tour-details)
PagesAbout (/about)
NewsNews (/news), News Details (/news-details)
Contact(direct link to /contact)

Active State Logic

Uses usePathname() from next/navigation to determine the current route. The isItemActive() function checks if the pathname matches any child href. Active parent <li> elements receive the current CSS class; matching child <li> elements receive the active class.

MobileNav

src/components/MobileNav.tsx "use client"

Purpose

Off-canvas mobile navigation drawer with accordion-style collapsible submenus.

Props

PropTypeDescription
isOpenbooleanControls drawer visibility
onClose() => voidCallback to close the drawer

Features

  • Overlay backdrop with click-to-close
  • Submenu toggle via openMenus Set state
  • Same navItems and active state logic as Header
  • Expanded class (.expanded) controls slide-in animation

src/components/Footer.tsx

Purpose

Site footer with branding, navigation links, social media, and CTA buttons.

Sections

  • Left: Logo + three link columns (Pages, Socials, Contact)
  • Right: Tagline "Travel smarter, greener, richer" + Contact Us & Subscribe buttons
  • Bottom: Brand text "Travel ♦ Tripura"

FadeIn

src/components/FadeIn.tsx "use client"

Purpose

Generic scroll-triggered animation wrapper using Framer Motion. Elements fade and slide into view when they enter the viewport.

Props

PropTypeDefaultDescription
childrenReactNode—Content to animate
classNamestring—CSS classes
styleCSSProperties—Inline styles
idstring—DOM id
direction"up" | "down" | "left" | "right""up"Slide direction
delaynumber0Delay in seconds
durationnumber0.6Duration in seconds
as"div" | "section" | "li" | "span""div"HTML element to render

Direction Offsets

DirectionInitial XInitial Y
up040px
down0-40px
left-60px0
right60px0

Usage

<FadeIn direction="up" delay={0.2}>
  <div className="tour-card">...</div>
</FadeIn>

<FadeIn as="li" direction="left" duration={0.8}>
  <span>Animated list item</span>
</FadeIn>

Preloader

src/components/Preloader.tsx "use client"

Purpose

Full-screen loading spinner shown on initial page load. Displays the Tripura star logo with a rotating ring.

Behavior

  • Visible for 500ms, then adds .preloader--hidden to fade out
  • At 1100ms, sets display: none to remove from flow
  • Cleans up timers on unmount

BackToTop

src/components/BackToTop.tsx "use client"

Purpose

Floating button in the bottom-right corner. Appears after scrolling 300px and smoothly scrolls to the top on click.

SearchPopup

src/components/SearchPopup.tsx "use client"

Purpose

Global search modal overlay with a text input and submit button. Toggled by the .active class. Includes overlay backdrop dismiss and body scroll locking.

PageBanner

src/components/PageBanner.tsx

Purpose

Reusable page header banner with a background image, title, and breadcrumb navigation.

Props

PropTypeDescription
titlestringPage heading text
breadcrumbs{ label: string; href?: string }[]Breadcrumb items (href makes it a link)

Usage

<PageBanner
  title="About Us"
  breadcrumbs={[
    { label: "Home", href: "/" },
    { label: "Pages" },
    { label: "About" },
  ]}
/>

Hooks

useAnimations

src/hooks/useAnimations.ts

Purpose

Handles scroll-triggered counter animations and progress bar fills using IntersectionObserver.

Features

TargetSelectorData AttributeAnimation
Odometer counters .odometer data-odometer-final or data-count Animates from 0 to target over 2s with cubic ease-out
Progress bars .count-bar data-percent Fills width over 1.5s with ease-out

Both use a 30% visibility threshold and trigger only once per element.

useSwiperInit

src/hooks/useSwiperInit.ts

Purpose

Finds all elements with .thm-swiper__slider[data-swiper-options], parses the JSON options from the data attribute, and creates Swiper instances.

Modules Loaded

  • Navigation — prev/next arrows
  • Pagination — dot indicators
  • Autoplay — auto-rotation
  • EffectFade — crossfade transitions

Usage in HTML

<div
  class="thm-swiper__slider swiper-container"
  data-swiper-options='{
    "slidesPerView": 1,
    "effect": "fade",
    "autoplay": { "delay": 5000 },
    "pagination": { "el": ".swiper-pagination", "clickable": true }
  }'
>
  <div class="swiper-wrapper">
    <div class="swiper-slide">...</div>
  </div>
</div>

useUIPlugins

src/hooks/useUIPlugins.ts

Purpose

Replaces multiple jQuery plugins with vanilla JavaScript equivalents. Initializes on mount and cleans up all event listeners on unmount.

Plugin Replacements

FeatureSelectorBehavior
Sticky Header .stricked-menu Clones nav into sticky element; adds .stricky-fixed on scroll > 130px
Accordion .accrodion-grp Single-open accordion — clicking a title toggles .active
Video Popup .video-popup Full-screen modal with iframe embed; auto-detects YouTube URLs
Image Popup .img-popup Lightbox overlay for image links
Background Slideshow .banner-bg-slide Rotates background images via JSON data-options
Price Range Slider #range-slider-price noUiSlider with range 0–6000 and live min/max display

Vendor CSS

External vendor stylesheets are loaded in the root layout via <link> tags. These files live in public/assets/vendors/.

LibraryPathPurpose
Font Awesome 7fontawesome/css/all.min.cssIcons (solid, regular, brands)
Jarallaxjarallax/jarallax.cssParallax background styles
noUiSlidernouislider/nouislider.min.cssRange slider styles
noUiSlider Pipsnouislider/nouislider.pips.cssSlider tick marks
Swiperswiper/swiper.min.cssCarousel base styles
Tripura Iconstripura-icons/style.cssCustom icon font
Reey Fontreey-font/stylesheet.cssDecorative display font

Deployment

All pages are statically prerendered at build time. The output can be deployed to any static hosting platform or Node.js server.

Build Output

npm run build

✓ Compiled successfully
✓ Generating static pages (14/14)

Routes:
  ○ /
  ○ /_not-found
  ○ /about
  ○ /contact
  ○ /destinations
  ○ /destinations-details
  ○ /home-two
  ○ /news
  ○ /news-details
  ○ /tour-details
  ○ /tours
  ○ /tours-list

Vercel (Recommended)

Deploy directly from your Git repository to Vercel. No additional configuration is required — Vercel auto-detects Next.js projects.

Self-Hosted

# Build and start
npm run build
npm start

# Or export as static HTML (add output: 'export' to next.config.ts)
npm run build
# Serve the 'out' directory with any static server

Tripura - Travel & Tour Next.js Template • Built with Next.js, React, and Tailwind CSS