GithubHelp home page GithubHelp logo

bkuste2 / react-tailwind-template Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 0.0 690 KB

Home Page: https://react-tailwind-template-kappa.vercel.app

JavaScript 15.84% HTML 8.96% TypeScript 71.79% CSS 3.40%
eslint prettier prettier-plugin-tailwindcss react snippets tailwindcss template typescript vite aliases-setup axios react-query

react-tailwind-template's Introduction

React + Tailwind + Eslint/Prettier

This template provides a basic setup for working with React (Vite). Here we use tailwind for styles, Axios and tanstack/react-query for data fetching and we use rocketseat/eslint-config for eslint (with prettier plugin) to promote better code standardization.

Additionally, we provide some aliases to make it easier to import folders.


To use this template you need to follow the next steps

git clone https://github.com/Bkuste2/react-tailwind-template.git
cd react-tailwind-template
yarn install
yarn dev

Aliases

These aliases are pre-configured in the project to help you with development

  • @
  • @pages
  • @components
  • @services
  • @contexts
  • @helpers
  • @types

If you want to create any alias, just follow the example below:

  • vite.config.ts
export default defineConfig({
  /* rest of your defineConfig function */
  resolve: {
    alias: {
      '@': resolve(__dirname, './src'), // example
      'your_alias': resolve(__dirname, 'folder_path'),
    },
  },

})
  • tsconfig.json
{
  "compilerOptions": {
    "paths": {
      "@/*": ["./src/*"], // example
      "your_alias/*": ["folder_path/*"]
    }
  }
}

Snippets

fc

Create a simple functional component initial setup

export interface FilenameProps {}

export const Filename: React.FC<FilenameProps> = () => {
  return (
   <div className="">
     <h1>Filename</h1>
   </div>
  )
}

cs

Create all useState structure

const [$1, set${2:$1}] = useState<$3>($4)

sb

Snippet to initial setup StorybookFile

import { Meta, StoryObj } from '@storybook/react'

export default {
	title: 'Component/ComponentName',
	component: ComponentName,
} as Meta

export const Default: StoryObj = {}

sbv

Snippet create an storybook variant

export const ${1:Default}: StoryObj = {}

react-tailwind-template's People

Contributors

bkuste2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-tailwind-template's Issues

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.