Spinner

Spinner is used to indicate loading status.

Import

import { Spinner } from '@ma9pie/lite-ui';

Source

components/Spinner.tsx

Examples

Size

import { Spinner } from '@ma9pie/lite-ui';
import React from 'react';

const App = () => {
  return (
    <div className="flex items-center gap-8 flex-wrap">
      <Spinner size={24}></Spinner>
      <Spinner></Spinner>
      <Spinner size={64}></Spinner>
    </div>
  );
};

export default App;

Color

import { Spinner } from '@ma9pie/lite-ui';
import React from 'react';

const App = () => {
  return (
    <div className="flex items-center gap-8 flex-wrap">
      <Spinner color="#ef4444"></Spinner>
      <Spinner color="#eab308"></Spinner>
      <Spinner color="#22c55e"></Spinner>
      <Spinner color="#3b82f6"></Spinner>
      <Spinner color="#8b5cf6"></Spinner>
    </div>
  );
};

export default App;

Line width

import { Spinner } from '@ma9pie/lite-ui';
import React from 'react';

const App = () => {
  return (
    <div className="flex items-center gap-8 flex-wrap">
      <Spinner></Spinner>
      <Spinner lineWidth={4}></Spinner>
      <Spinner lineWidth={5}></Spinner>
    </div>
  );
};

export default App;

Duration

import { Spinner } from '@ma9pie/lite-ui';
import React from 'react';

const App = () => {
  return (
    <div className="flex items-center gap-8 flex-wrap">
      <Spinner duration={500}></Spinner>
      <Spinner></Spinner>
      <Spinner duration={1000}></Spinner>
    </div>
  );
};

export default App;

API

Spinner props

Property
Type
Description
Default
size
number
Spinner's size.
32
color
string
Spinner's color.
"#d4d4d4"
lineWidth
number
Spinner's line thickness.
3
duration
number
Spinner's rotation time.
750

Default props

Property
Type
Description
Default
key
string
Unique key that identifies repeated elements.
-
className
string
Attribute used to add classes to HTML elements.
-
style
CSSProperties
Attribute used to apply CSS styles directly to HTML elements.
-

Made by ma9pie

Deployed on

vercel