No Preview

Sorry, but you either have no stories or none are selected somehow.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

The component failed to render properly, likely due to a configuration issue in Storybook. Here are some common causes and how you can address them:

  1. Missing Context/Providers: You can use decorators to supply specific contexts or providers, which are sometimes necessary for components to render correctly. For detailed instructions on using decorators, please visit the Decorators documentation.
  2. Misconfigured Webpack or Vite: Verify that Storybook picks up all necessary settings for loaders, plugins, and other relevant parameters. You can find step-by-step guides for configuring Webpack or Vite with Storybook.
  3. Missing Environment Variables: Your Storybook may require specific environment variables to function as intended. You can set up custom environment variables as outlined in the Environment Variables documentation.

Grafana React Components

With @grafana/ui, we want to democratize development. This library of reusable Grafana components and guidelines is part of the Saga Design System and should help you with contribution and plugin development.

Our vision

Grafana Labs started @grafana/ui to make contributing to Grafana as easy as possible for Grafanistas and community members of all fields. We want to create a component library that results in:

  • Understanding of how each component works and how you can use it to create a great user experience.
  • Short development times and consistent code quality.
  • A beautiful, visually consistent Grafana experience.
  • Transparency about how we work and what we do.

How to get involved

When we notice that we need to change something, we determine together what the change should be, then we put the change in place and communicate it publicly. Developers and designers create and improve @grafana/ui together. Throughout the process, we strive to involve you and meet your needs. We are looking forward to discussing your design and improvement ideas, find out how you can help in the Contribution Guidelines.

Get started

  • Explore UI components Click on any of the components in the sidebar to see how they look, and how to configure them. Each component contains documentation of its properties, as well as code examples for how to use it.

  • Try them out

    • Experiment with different properties, by clicking on each component story.
    • Change the properties under Controls in the side panel.
  • Use them Once you've found the right component for your use case, click the Code tab to see the code implementation, or look at examples under Docs.

    For more details, refer to the package source.

Installation

yarn add @grafana/ui

npm install @grafana/ui