npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cra-template-bushido-lite

v1.1.6

Published

The bushido template without redux and axios

Downloads

39

Readme

Welcome to Jimmy's Custom Template, Bushido Lite!

This is the Bushido package without the redux setup.

How To Install

yarn

yarn create react-app <app-name> --template bushido-lite

npm

npm init react-app <app-name> --template bushido-lite

npx

npx create-react-app <app-name> --template bushido-lite

global

If create-react-app is installed globally on your computer you can use this command:

create-react -app <app-name> --template bushido-lite

Just like regular create-react-app but so much more. This template includes:

  • @callstack/react-theme-provider
  • bushido-strap
  • react-router
  • react-router-dom
  • serve
  • webfontloader

There is also a serve script that let's your run serve -s build and a build-and-serve script that runs npm run build && npm run serve.

This is based off the bushido template I created. Only it's without redux and axios hooked up. So if your working on a simple site that doesn't need to make API calls or use Redux for a global state, this is the template you want to use.

Routes are set in App.js and all components for routes are built in components folder.

BUSHIDO-STRAP

What is bushido-strap? Well, friend, it is a personal style library I create. It's just a bunch of nifty little styled components I've slowly crafted over time. Learning from my peers has probably been the greatest contribution to this project! It's already set up in this template, so check it out! Here's the documentation, so you can to see everything this modest style library has to offer!

Using Google Fonts

WebFontLoader is used for this. Although, they do more than just load Google fonts efficiently. Check out their documentation here!.

In the App.js you will see:

// Using Web Font Loader for google fonts
import WebFont from "webfontloader";

// setting our font variables
const h_font = "Comfortaa";
const r_font = "Montserrat";

// using WebFont to easily access Google fonts
WebFont.load({
  google: {
    families: [h_font, r_font],
  },
});

export default function App() {
  return (
    <AppWrapper head_font={h_font} font={r_font}>
      <Route path="/" exact component={Dashboard} />
      <Route path="/counter" component={ReduxCounter} />
    </AppWrapper>
  );
}

All you need to do is add any Google font name to the h_font variable to change the heading (h1-h6) font for the whole site and add change the r_font variable to change the font for everything else.

Adding A Custom Theme

React Theme Provider is set up so you can edit bushido-strap theme's or add your own to use! Just add a theme prop in the ThemeProvider in src/index.js and pass in your custom theme object. You can then import the useTheme hook from your scr/index.js and set const theme = useTheme(); in your component and you can freely access any of your theme variables by simply accessing your theme variable: color={theme.myCustomColor}.

Example:

Create a theme.js file in your src folder:

const theme = {
  myColorOne: "red",
  myColorTwo: "blue",
  // if you want to override bushido strap values just reassign them here
  gray0: "black",
};

export default theme;

Add your custom theme object to your src/index.js:

import theme from "./theme";

Now pass that theme to your ThemeProvider:

ReactDOM.render(
  <Provider store={store}>
    <Router>
      <ThemeProvider theme={theme}>
        <App />
      </ThemeProvider>
    </Router>
  </Provider>,
  document.getElementById("root")
);

And now you can access both your and bushido-strap's theme objects by importing the useTheme hook from scr/index.js. Any overrides in your theme object will be favored over bushido-strap's theme. 👌

If you don't set up your own custom theme you can just import theme from "bushido-strap/styled/theme and use the default theme.