packages/grafana-ui/src/components/Divider/Divider.mdx
import { Meta, ArgTypes } from '@storybook/addon-docs/blocks'; import { Divider } from './Divider';
<Meta title="MDX|Divider" component={Divider} />When creating separation between large sections of page content or smaller parts of components like in the page info section of the header.
Dividers should be used sparingly.
Don’t use dividers when white space (padding / margins) is sufficient to separate out sections. When sections are related to each other, they may not need dividers (ex: filtering / search related to a table).
import { Divider } from '@grafana/ui';
<header>
<h1>My title here</h1>
</header>
<Divider />
<main>
<p>Main content goes here</p>
</main>
import { Divider } from '@grafana/ui';
<header>
<h1>My title here</h1>
<Divider direction="vertical" />
</header>
<main>
<p>Main content goes here</p>
</main>
Pass a spacing token into the spacing prop to adjust the margin.
import { Divider } from '@grafana/ui';
<header>
<h1>My title here</h1>
<Divider direction="vertical" spacing={0.5}/>
</header>
<main>
<p>Main content goes here</p>
</main>
- Import and add the Divider component inside the code where you would normally add an hr or a div.
- Do not modify the color of the divider