GithubHelp home page GithubHelp logo

andrewjbateman / react-tailwind-tables Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 1.09 MB

:clipboard: A React app using react-tables to display REST API data

JavaScript 72.45% HTML 17.49% CSS 10.06%
react react-table tailwindcss craco purgecss axios-middleware

react-tailwind-tables's Introduction

⚑ React Tailwind Tables

  • A React app using react-tables to display REST API data
  • Code from CoderOne with modifications to styling
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

πŸ“„ Table of contents

πŸ“š General Info

  • Fake Store API provides data for e-commerce or shopping website prototypes
  • React Hooks used so state etc. can be used without writing a class
  • React Table useTable root hook used
  • Table is not responsive - set up for PC screen size
  • Table Edit buttons do not edit anything, they just create an alert
  • Yarn used instead of npm for this project

πŸ“· Screenshots

Example screenshot

πŸ“Ά Technologies

  • React v17 Javascript library.
  • Tailwind v2 utility-first CSS framework
  • twin.macro v2 to mix Tailwind with css-in-js
  • @craco/craco v6 Create React App Configuration Override, an easy and comprehensible configuration layer for create-react-app. Required because Create React App doesn’t let you override the PostCSS configuration natively
  • PostCSS v8 tool for transforming CSS with JavaScript
  • react-table v7 Hooks for building lightweight, fast and extendable datagrids for React
  • axios v0.21.4 Promise based HTTP client for the browser and node.js
  • Fake Store API for testing of e-commerce or shopping website prototype
  • Thunderclient VSCode extension Rest Client for Testing APIs

πŸ’Ύ Setup

  • yarn start runs the app in the development mode. Open http://localhost:3000 to view it in the browser.
  • yarn build builds the app for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.
  • yarn test to run testing - no tests added, testing fails

πŸ’» Code Examples by CoderOne

  • function const to define table using spread operator and add edit column
	const tableHooks = (hooks) => {
		hooks.visibleColumns.push((columns) => [
			...columns,
			{
				id: "Edit",
				Header: "Edit",
				Cell: ({ row }) => (
					<Button onClick={() => alert("Editing: " + row.values.price)}>
						Edit
					</Button>
				),
			},
		]);
	};

πŸ“‹ Status & To-Do List

  • Status: Working
  • To-Do: Change REST API and try different tw styles. Add testing

πŸ‘ Inspiration

πŸ“ License

  • N/A

βœ‰οΈ Contact

react-tailwind-tables's People

Contributors

andrewjbateman avatar

Watchers

 avatar  avatar  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.