mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 13:39:19 -06:00
Docs: Storybook - Spinner (#26754)
* add docs for spinner component * fix lint * Code review fixes
This commit is contained in:
parent
41f7bccb24
commit
fa7c4d91aa
17
packages/grafana-ui/src/components/Spinner/Spinner.mdx
Normal file
17
packages/grafana-ui/src/components/Spinner/Spinner.mdx
Normal file
@ -0,0 +1,17 @@
|
||||
import { Meta, Story, Preview, Props } from '@storybook/addon-docs/blocks';
|
||||
import { Spinner } from './Spinner';
|
||||
|
||||
<Meta title="MDX|Spinner" component={Spinner} />
|
||||
|
||||
# Spinner
|
||||
|
||||
Spinner is `fa-spinner` icon animated. It is used to alert a user to wait for an activity to complete.
|
||||
|
||||
<Preview>
|
||||
<div>
|
||||
<Spinner />
|
||||
<Spinner className="my-spin-div" iconClassName="my-spinner-classname" size={24}/>
|
||||
</div>
|
||||
</Preview>
|
||||
|
||||
<Props of={Spinner} />
|
@ -1,12 +1,18 @@
|
||||
import React from 'react';
|
||||
|
||||
import { number, color } from '@storybook/addon-knobs';
|
||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||
import { Spinner } from '@grafana/ui';
|
||||
import mdx from './Spinner.mdx';
|
||||
|
||||
export default {
|
||||
title: 'Visualizations/Spinner',
|
||||
component: Spinner,
|
||||
decorators: [withCenteredStory],
|
||||
parameters: {
|
||||
docs: {
|
||||
page: mdx,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const basic = () => {
|
||||
@ -16,3 +22,17 @@ export const basic = () => {
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const withStyle = () => {
|
||||
return (
|
||||
<div>
|
||||
<Spinner
|
||||
style={{
|
||||
backgroundColor: color('White', 'white'),
|
||||
color: color('Red', 'red'),
|
||||
}}
|
||||
size={number('Size', 34)}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user