monday-ui-react-core
Version:
Official monday.com UI resources for application development in React.js
113 lines (80 loc) • 2.83 kB
text/mdx
import Loader from "../Loader";
import { Canvas, Meta } from "@storybook/blocks";
import { ComponentRules, UsageGuidelines } from "vibe-storybook-components";
import { Flex } from "../..";
import {
BUTTON,
LINEAR_PROGRESS_BAR,
SKELETON
} from "../../../storybook/components/related-components/component-description-map";
import { TipSkeleton } from "./Loader.stories.helpers";
import * as LoaderStories from "./Loader.stories";
import "./Loader.stories.scss";
<Meta of={LoaderStories} />
- [Overview](
- [Props](
- [Usage](
- [Variants](
- [Do’s and don’ts](
- [Use cases and examples](
- [Related components](
- [Feedback](
Circular loader indicates to user waiting state.
<Canvas of={LoaderStories.Overview} />
<PropsTable />
<UsageGuidelines
guidelines={[
"Use this loader to load small parts of the system, not the whole pages.",
"Use sizes of loader in context to its position. The bigger the loading area gets, the bigger loader should be used.",
"Always place loader in context to the loading content."
]}
/>
<TipSkeleton />
<Canvas of={LoaderStories.SizeVariants} />
<Canvas of={LoaderStories.ColorVariants} />
If there is a need for color customization, css `color` attribute of a parent component can be used.
<Canvas of={LoaderStories.CustomColors} />
<Canvas of={LoaderStories.VisualVariants} />
<ComponentRules
rules={[
{
positive: {
component: (
<Flex direction={Flex.directions.ROW}>
<div className="monday-storybook-loader_dos-and-donts_heading">H1 heading component</div>
<Loader size={Loader.sizes.SMALL} hasBackground />
</Flex>
),
description: "Place loader in context to the loading content and keep its size proportional to the content."
},
negative: {
component: (
<Flex direction={Flex.directions.ROW}>
<div className="monday-storybook-loader_dos-and-donts_heading">H1 heading component</div>
<Loader size={Loader.sizes.LARGE} hasBackground />
</Flex>
),
description: "Don’t leave the size visually unmaintained."
}
}
]}
/>
Use loader in search field while filtering results.
<Canvas of={LoaderStories.LoaderInTextField} />
Indicate the loading status in button if content or an action is loading.
<Canvas of={LoaderStories.LoaderInButton} />
<RelatedComponents componentsNames={[SKELETON, LINEAR_PROGRESS_BAR, BUTTON]} />