Giter Site home page Giter Site logo

styled-react-boilplate's Introduction

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

  • Less complex than create-react-app
  • Features styled-components
  • Uses React Hooks
  • Includes optimized Webpack & Babel configuration
  • Perfect Lighthouse score
  • Non-blocking CSS & fonts loading
  • Friendly errors & warnings
  • Ensures clean code with xo & stylelint
  • Normalizes default browser style with modern-normalize
  • HTML template with social media meta tags
  • Targets the latest browsers
  • Works offline
  • Preconfigured React Refresh using react-refresh-webpack-plugin

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

  • PWA
  • Testing
  • module & nomodule support

Related

License

MIT

styled-react-boilplate's People

Contributors

paulweezydesign avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.