Home

Awesome

Styled React Boilerplate āš›ļø šŸ’…

Minimal & Modern Boilerplate for building apps with React & styled-components

Build Status XO code style style: styled-components

Demo Site ā€¢ FAQ


Highlights

File Tree

ā”œā”€ā”€ public                # Folder for static assets
ā”‚Ā Ā  ā”œā”€ā”€ favicon.png       # Favicon
ā”‚Ā Ā  ā””ā”€ā”€ index.html        # HTML template
ā”œā”€ā”€ src                   # Main folder
ā”‚Ā Ā  ā”œā”€ā”€ components        # Subfolder with components
ā”‚Ā Ā  ā”‚Ā Ā  ā”œā”€ā”€ button.js
ā”‚Ā Ā  ā”‚Ā Ā  ā””ā”€ā”€ container.js
ā”‚Ā Ā  ā”‚Ā Ā  ā””ā”€ā”€ counter.js
ā”‚Ā Ā  ā”‚Ā Ā  ā””ā”€ā”€ header.js
ā”‚Ā Ā  ā”‚Ā Ā  ā””ā”€ā”€ image.js
ā”‚Ā Ā  ā””ā”€ā”€ app.js            # Main page file
ā”‚Ā Ā  ā””ā”€ā”€ index.js          # React DOM, service worker config
ā”œā”€ā”€ webpack.config.js     # Webpack config
ā”œā”€ā”€ babel.config.js       # Babel config

Usage

# Install dependencies

 $ npm install

# Start webpack-dev-server at port 8080

 $ npm start

# Run linters

 $ npm test

# Build app for production (gets output in the 'dist' directory)

 $ npm run build

FAQ

How to deploy my app?

I recommend to use either Vercel or Netlify for hosting your site.

Deploy with Vercel Deploy to Netlify

How to add & use static assets (ex. images)?

Place them in the public directory in the root of the project. You can then use them like in the example below:

// Import files from the `public` directory
import imgSrc from '../../public/favicon.png';

// Then you can reference it like so:
const Image = () => (
	<img src={imgSrc} alt="āš”"/>
);

Check out the Image component for a live example.

TODO

Related

License

MIT