overview.stories.mdx 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { Meta } from '@storybook/addon-docs';
  2. import StylesVariantsComponets from '../../images/core-overview-styles-variants-components.png';
  3. <Meta title="Core/Overview" />
  4. # Overview
  5. 👋 Hello there! You've arrived at Sentry's UI System guidebook. Here, you will find a detailed account of our UI system, including interactive examples and recommended use cases. We want to have appropriate and consistent use of our components, so that's why this guidebook exists!
  6. ## Structure
  7. * **`CORE`**: foundational styles that are used throughout the entire UI system, like color, typography,…
  8. * **`ASSETS`**: logos, images, icons,…
  9. * **`COMPONENTS`**: reusable components, with detailed descriptions and recommended use cases
  10. * **`VIEWS`**: layouts and other UI groups that are composed of multiple components
  11. * **`UTILITIES`**: UI-related functions, like text formatters, truncators,…
  12. * **`DEPRECATED`**: legacy components that should no longer be used; they are here for documentation purposes only
  13. ## Usage
  14. Here's how to make the best use of this guide:
  15. - Press `/` to perform a quick search, you can search by category or component name
  16. - When viewing components, check out the `Control`, `Accessibility`, and other useful tabs in the bottom panel
  17. - Play around with features in the top bar, you can:
  18. - Zoom in/out
  19. - Simulate screen sizes
  20. - See what the component looks like for color-blind users
  21. - Ping Vu Luong or someone in the Product Design team if you're not sure about anything related to UI systems
  22. ## Styles, variants, and components
  23. Sentry's UI system has three fundamental building blocks: styles, variants, and components. You will see these concepts mentioned throughout this guide, so it's good to understand what each of them means and how they are different from one another.
  24. **Styles** are specific definitions/assignments for UI attributes, like background color, font size, and border. For example, `background-color: #FFFFFF` is a style.
  25. **Variants** are predefined style combinations. For example, we can define a `primary` variant for buttons that consists of the following styles: `background color: #6C5FC7`, `text color: #FFFFFF`, and `border: 1px #3E2C73`. (Note: we use hard-coded values, like `#6C5FC7`, for demonstration purposes only. We strongly discourage using them in the code. Instead, use predefined variables like `theme.backgroundColor`.)
  26. **Components** are flexible, reusable UI elements such as buttons, dialogs, and badges. A component can adopt one of many variants, and one or more styles. For example, a button can adopt a `primary` or `secondary` variant. It can also use one or more additional styles if the variant definitions are not enough.
  27. <img src={StylesVariantsComponets} alt="Diagram with three columns: Styles, Variants, and Components" />