All Projects → wadackel → React Md Spinner

wadackel / React Md Spinner

Licence: mit
Material Design spinner components for React.js.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to React Md Spinner

Material Ui Datatables
An another React Data tables component.
Stars: ✭ 163 (-16.41%)
Mutual labels:  material-design, react-component
Yoshino
A themable React component library!Flexible Lightweight PC UI Components built on React! Anyone can generate easily all kinds of themes by it!
Stars: ✭ 216 (+10.77%)
Mutual labels:  material-design, react-component
Quickactionview
View that shows quick actions when long pressed, inspired by Pinterest
Stars: ✭ 185 (-5.13%)
Mutual labels:  material-design
Vantage Ui Template
Template for UI applications in Vantage
Stars: ✭ 193 (-1.03%)
Mutual labels:  material-design
React Country Region Selector
Country / region React select boxes for your forms.
Stars: ✭ 189 (-3.08%)
Mutual labels:  react-component
React Anchor Link Smooth Scroll
React component for anchor links using the smooth scroll polyfill.
Stars: ✭ 186 (-4.62%)
Mutual labels:  react-component
Materialstepperview
Steppers - Material Design Components for Android
Stars: ✭ 2,187 (+1021.54%)
Mutual labels:  material-design
Whatsappbetaupdater
An app to update WhatsApp to the latest beta version available on Android. Based on Material Design.
Stars: ✭ 183 (-6.15%)
Mutual labels:  material-design
Vue Cool Select
Select with autocomplete, slots, bootstrap and material design themes.
Stars: ✭ 195 (+0%)
Mutual labels:  material-design
Wanna
💡✔ Wanna is an implementation of a 21st-century to-do list app.
Stars: ✭ 189 (-3.08%)
Mutual labels:  material-design
Acgn Community
A community app for news,animation,music and novels developed material design style.
Stars: ✭ 193 (-1.03%)
Mutual labels:  material-design
Elegantdialog
A beautiful, customizable and interactive dialog for Android written in Kotlin/Java 😍
Stars: ✭ 189 (-3.08%)
Mutual labels:  material-design
Home Panel
A web frontend for controlling the home.
Stars: ✭ 185 (-5.13%)
Mutual labels:  material-design
Wanandroid flutter
Flutter完整项目,玩Android-Flutter版客户端。
Stars: ✭ 190 (-2.56%)
Mutual labels:  material-design
Fontawesome.sharp
A library for using Font Awesome in WPF & Windows Forms applications
Stars: ✭ 185 (-5.13%)
Mutual labels:  material-design
Covalent
Teradata UI Platform built on Angular Material
Stars: ✭ 2,230 (+1043.59%)
Mutual labels:  material-design
Musiclake
MediaPlayer、Exoplayer音乐播放器,可播在线音乐,qq音乐,百度音乐,虾米音乐,网易云音乐,YouTuBe
Stars: ✭ 2,291 (+1074.87%)
Mutual labels:  material-design
Beamermaterialdesign
Theme for Beamer inspired by Google's Material Design
Stars: ✭ 186 (-4.62%)
Mutual labels:  material-design
React Native Image Viewer
🚀 tiny & fast lib for react native image viewer pan and zoom
Stars: ✭ 2,334 (+1096.92%)
Mutual labels:  react-component
React Voice Components
Set of React components that use the Web Speech API to bring voice experience to React applications
Stars: ✭ 195 (+0%)
Mutual labels:  react-component

react-md-spinner

Screenshot

Build Status npm version

Material Design spinner components for React.js.

Live example: https://tsuyoshiwada.github.io/react-md-spinner/

Table of Contents

Installation

You can install the react-md-spinner from npm.

$ npm i -S react-md-spinner
# or
$ yarn add react-md-spinner

Features

  • 🚀 You can start using with zero configuration!
  • 🔧 Support to change of color, size, border and animation speed.
  • 💖 It can also be used in single color.
  • 🌐 Support Server-Side Rendering.

Getting Started

Basic Usage

Because it is made of 100% inline styles, you can start using it right away without setting.

import React from "react";
import MDSpinner from "react-md-spinner";

export const SpinnerExample: React.FC = () => (
  <div>
    <MDSpinner />
  </div>
);

Server-Side Rendering

The following is an example of Server-Side Rendering.
Please checkout examples directory for details.

The point is to use ssrBehavior.

Example

Note: The following is pseudo code.

Client-Side:

import React from "react";
import { render } from "react-dom";
import App from "./App";

render(<App />, document.getElementById("app"));

Server-Side:

import { ssrBehavior } from "react-md-spinner";

// ...

const html = (root: JSX.Element) => `<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    ${ssrBehavior.getStylesheetString()}
  </head>
  <body>
    <div id="app">${renderToString(root)}</div>
    <script defer src="/client.js"></script>
  </body>
</html>`;

app.get("/", (_req, res) => {
  res.status(200).send(`<!doctype html>${renderer(<App />)}`);
});

App:

import React from "react";
import MDSpinner from "react-md-spinner";

export const App: React.FC = () => (
  <div>
    <MDSpinner />
  </div>
);

Props

You can use the following Props. All Props are Optional!

size

type: number
default: 28

Set the size (diameter) of the spinner circle.

borderSize

type: number
default: undefined

Set the spinner border size of. By default, the appropriate size is calculated according to the value of size.

duration

type: number
default: 1333

Set the animation duration (ms) of the spinner.

color1

type: string
default: !rgb(66, 165, 245)

The color of the spinner. Can be set to any valid CSS string (hex, rgb, rgba).

color2

type: string
default: rgb(239, 83, 80)

Same as above.

color3

type: string
default: rgb(253, 216, 53)

Same as above.

color4

type: string
default: rgb(76, 175, 80)

Same as above.

singleColor

type: string
default: undefined

Same as above. Use this if the spinner should be in only one single color. The settings (props) for color1 ~ 4 will be ignored by setting this singleColor property.

API

ssrBehavior

In Server-Side Rendering you need to inject @keyframes inside the <head>.
react-md-spinner provides utilities to handle them.

  • ssrBehavior.getStylesheetString(): string
  • ssrBehavior.getStylesheetComponent(): React.ReactNode

As string output

import { ssrBehavior } from "react-md-spinner";

const html = () => `<!doctype html>
  <head>
    ${ssrBehavior.getStylesheetString()}
  </head>
  <body>
    <div id="app">
      // React stuff here
    </div>
  </body>
</html>`;

As React Components

import React from "react";
import { ssrBehavior } from "react-md-spinner";

const Html: React.FC = () => (
  <html>
    <head>{ssrBehavior.getStylesheetComponent()}</head>
    <body>
      <div id="app">{/* React stuff here */}</div>
    </body>
  </html>
);

ChangeLog

See CHANGELOG.md

Contributing

We are always welcoming your contribution 👏

  1. Fork (https://github.com/tsuyoshiwada/react-md-spinner) 🎉
  2. Create a feature branch ☕️
  3. Run test suite with the $ yarn test command and confirm that it passes ⚡️
  4. Commit your changes 📝
  5. Rebase your local changes against the master branch 💡
  6. Create new Pull Request 💌

Available Scripts

yarn test

Run unit test using Jest.

yarn lint

Run Lint of source code using ESLint.

yarn format

Run formatting using Prettier and ESLint's Fixer.

yarn build

Run build of TypeScript code.

yarn storybook

Run Storybook.

License

MIT © tsuyoshiwada

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].