Created Legend.mdx (#26146)

Add simple docs to legend component

Signed-off-by: Oana <oana.mangiurea@gmail.com>
pull/26170/head
Oana Mangiurea 6 years ago committed by GitHub
parent 14209c0ed1
commit 84bf94709e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      packages/grafana-ui/src/components/Forms/Legend.mdx
  2. 6
      packages/grafana-ui/src/components/Forms/Legend.story.tsx

@ -0,0 +1,23 @@
import { Story, Preview, Props } from '@storybook/addon-docs/blocks';
import { Legend } from './Legend';
<Meta title="MDX|Legend" component={Legend} />
# Legend
### When to use
Legend should be used to add a caption to a group of related form elements that have been grouped toegheter into a `FieldSet`.
### Usage
```jsx
import { Forms } from '@grafana/ui';
<Legend>{label}</Legend>
```
### Props
<Props of={Legend} />

@ -2,6 +2,7 @@ import React from 'react';
import { text } from '@storybook/addon-knobs';
import { Legend } from './Legend';
import mdx from './Legend.mdx';
const getKnobs = () => {
return {
@ -12,6 +13,11 @@ const getKnobs = () => {
export default {
title: 'Forms/Legend',
component: Legend,
parameters: {
docs: {
page: mdx,
},
},
};
export const basic = () => {

Loading…
Cancel
Save