DEV Community

Cover image for NextSSS, Next.js static site starter
Kite
Kite

Posted on

1 2

NextSSS, Next.js static site starter

I made a Next.js starter template especially for static site. It includes full setup for TypeScript, Tailwind CSS, Sass, Google Analytics, Next SEO, active link component, etc.

GitHub: https://github.com/ixkaito/nextsss

How to Use

Execute create-next-app with npm or Yarn to bootstrap the template:

npx create-next-app --example https://github.com/ixkaito/nextsss
# or
yarn create next-app --example https://github.com/ixkaito/nextsss
Enter fullscreen mode Exit fullscreen mode

Google Analytics

Edit GA_TRACKING_ID in /lib/gtag.ts.

Example:

export const GA_TRACKING_ID = 'G-XXXXXXXXXX'
Enter fullscreen mode Exit fullscreen mode

Active className on a link

Example:

import Link from '../components/ActiveLink'

const Nav: React.FC = () => {
  return (
    <nav>
      <Link href="/">
        <a>Home</a>
      </Link>
      <Link href="/about/">
        <a>About</a>
      </Link>
    </nav>
  )
}

export default Nav
Enter fullscreen mode Exit fullscreen mode

This will dynamically add the active class name to each links. You can also change the activeClassName like this:

import Link from '../components/ActiveLink'

const Nav: React.FC = () => {
  return (
    <nav>
      <Link href="/" activeClassName="current">
        <a>Home</a>
      </Link>
      <Link href="/about/" activeClassName="current">
        <a>About</a>
      </Link>
    </nav>
  )
}

export default Nav
Enter fullscreen mode Exit fullscreen mode

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay