Skip to content
Snippets Groups Projects
Commit 4efd84e5 authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

Enhance Spinner component and write docs

parent 14e38ceb
No related branches found
No related tags found
No related merge requests found
......@@ -4,9 +4,11 @@ import { Icon } from '@pubsweet/ui'
import classes from './Spinner.local.scss'
const Spinner = () => (
const Spinner = ({ icon = 'loader', size = 16, color = '#444' }) => (
<div className={classnames(classes.rotate, classes.icon)}>
<Icon size={16}>loader</Icon>
<Icon color={color} size={size}>
{icon}
</Icon>
</div>
)
......
# Spinner
Spinning icon used when loading or waiting for API calls to finish.
## Props
| Prop | Description | Required | Default | Type |
| :---: | :--------------------------------------------------------------------------: | :------: | :------: | :----: |
| icon | Name of the icon to be used as a spinner. Can be any valid FeatherIcon icon. | false | 'loader' | string |
| size | The size of the spinner | false | 16 | number |
| color | Color of the spinner. | false | '#444' | string |
## Examples
```js
import { Spinner } from 'pubsweet-components-faraday/src/components'
<Spinner /> // renders the default spinner
<Spinner color="pink" size={40} icon="compass" /> // renders a huge pink spinning compass
```
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment