<Styled Starter/>

Starter Kit for creating Server-Side Rendered React Apps with Next.js and Styled System Components

Download Starter Kit

Use Styled Starter to get a React project up and running quickly with Server-Side Rendering (thanks to Next.js) and a built-in design system (thanks to Styled Components with Styled System).

Getting Started

First, download the basic starter kit, then install from within the project directory.

npm install

Get a dev environment up and running.

npm run dev

Open up localhost:3000 on your browser and you should see a page that looks like this.

Pages and Routing

By default, the starter project has two pages: an index page and an about page.

To add a new page, go to src/pages and duplicate About.js then change its name and edit it.

// src/pages/NewPage.js

import { Box } from 'styled-system';
import SiteFooter from '../components/SiteFooter'

export default (props) => (
		<Box p={6} mw="1200px" mx="auto" align="center">
				/* Page content will go here */ 
		<SiteFooter />

Next, go to the top level pages directory and create a new page.

// pages/newpage.js

import NewPage from '../src/pages/NewPage'
import Page	from '../src/containers/Page'

export default () => (
	<Page name="NewPage" prefix="..">
    	<NewPage />

That’s it! Well, unless your project is a Github project page. For that, you will need to set up next.config.js (see this branch for more info).

Components and Content

Compose UI with Styled System primitives and components like Grid Styled, Styled System HTML (SSHTML).

SSHTML looks a lot like regular HTML. The key difference is every SSHTML element is a styled component that inherits style props from your design theme. SSHTML is built on top of Styled System which includes Grid Styled making it easy to build responsive layouts.

We can use SSHTML elements as primitives when creating components. For example, to use a Blockquote component like this...

Son, you have the eyes of an eagle... a dead one.
Grandpa Polacek
<Blockquote author="Grandpa Polacek">Son, you have the eyes of an eagle... a dead one.</Blockquote>

... you might create that component from SSHTML like this...

import { Blockquote, Footer } from 'styled-system-html';

export default (props) => (
        bg="gray0" color="base" 
        px={4} py={3} 
        borderLeft borderWidth={4} borderColor="gray2"
        f={4} fontStyle="italic">
            props.author &&
            <Footer mt={2} align="right" pr={5} f={1} color="gray">{props.author}

There are many ways to build components with Styled System. More documention and examples are in the Design section of this site.

See also:


To adjust colors, layout and typography, edit the theme file in the /src directory. Generate theme data by setting custom fonts or colors in the Theme section. You can also choose from a selection of sample themes by clicking choose theme at the top of this page.

State Management

This demo uses Refunk for state management. It is a simpler, smaller alternative to other state management libraries that makes use of React’s built-in component state. See Styled Starter with Refunk.

Publish and Deploy

The default deploy script will publish to github if you update package.json with your repository url.

For more information on publishing and deploying, refer to the Next.js documentation. To publish as a Github Page, refer to


Included is a very simple end-to-end Selenium integration test which can be run in your local environment. With the server running:

npm run test

For a more detailed example, with integration with Travis CI and SauceLabs, refer to the tests directory in the Styled Starter project repo. More info:

Bring your own unit tests (BYOUT).