Introduction.mdx 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. import { Meta } from '@storybook/blocks';
  2. import Code from './assets/code-brackets.svg';
  3. import Colors from './assets/colors.svg';
  4. import Comments from './assets/comments.svg';
  5. import Direction from './assets/direction.svg';
  6. import Flow from './assets/flow.svg';
  7. import Plugin from './assets/plugin.svg';
  8. import Repo from './assets/repo.svg';
  9. import StackAlt from './assets/stackalt.svg';
  10. <Meta title="Example/Introduction" />
  11. <style>
  12. {`
  13. .subheading {
  14. --mediumdark: '#999999';
  15. font-weight: 700;
  16. font-size: 13px;
  17. color: #999;
  18. letter-spacing: 6px;
  19. line-height: 24px;
  20. text-transform: uppercase;
  21. margin-bottom: 12px;
  22. margin-top: 40px;
  23. }
  24. .link-list {
  25. display: grid;
  26. grid-template-columns: 1fr;
  27. grid-template-rows: 1fr 1fr;
  28. row-gap: 10px;
  29. }
  30. @media (min-width: 620px) {
  31. .link-list {
  32. row-gap: 20px;
  33. column-gap: 20px;
  34. grid-template-columns: 1fr 1fr;
  35. }
  36. }
  37. @media all and (-ms-high-contrast:none) {
  38. .link-list {
  39. display: -ms-grid;
  40. -ms-grid-columns: 1fr 1fr;
  41. -ms-grid-rows: 1fr 1fr;
  42. }
  43. }
  44. .link-item {
  45. display: block;
  46. padding: 20px;
  47. border: 1px solid #00000010;
  48. border-radius: 5px;
  49. transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out;
  50. color: #333333;
  51. display: flex;
  52. align-items: flex-start;
  53. }
  54. .link-item:hover {
  55. border-color: #1EA7FD50;
  56. transform: translate3d(0, -3px, 0);
  57. box-shadow: rgba(0, 0, 0, 0.08) 0 3px 10px 0;
  58. }
  59. .link-item:active {
  60. border-color: #1EA7FD;
  61. transform: translate3d(0, 0, 0);
  62. }
  63. .link-item strong {
  64. font-weight: 700;
  65. display: block;
  66. margin-bottom: 2px;
  67. }
  68. .link-item img {
  69. height: 40px;
  70. width: 40px;
  71. margin-right: 15px;
  72. flex: none;
  73. }
  74. .link-item span,
  75. .link-item p {
  76. margin: 0;
  77. font-size: 14px;
  78. line-height: 20px;
  79. }
  80. .tip {
  81. display: inline-block;
  82. border-radius: 1em;
  83. font-size: 11px;
  84. line-height: 12px;
  85. font-weight: 700;
  86. background: #E7FDD8;
  87. color: #66BF3C;
  88. padding: 4px 12px;
  89. margin-right: 10px;
  90. vertical-align: top;
  91. }
  92. .tip-wrapper {
  93. font-size: 13px;
  94. line-height: 20px;
  95. margin-top: 40px;
  96. margin-bottom: 40px;
  97. }
  98. .tip-wrapper code {
  99. font-size: 12px;
  100. display: inline-block;
  101. }
  102. `}
  103. </style>
  104. # Welcome to Storybook
  105. Storybook helps you build UI components in isolation from your app's business logic, data, and context.
  106. That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA.
  107. Browse example stories now by navigating to them in the sidebar.
  108. View their code in the `stories` directory to learn how they work.
  109. We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages.
  110. <div className="subheading">Configure</div>
  111. <div className="link-list">
  112. <a
  113. className="link-item"
  114. href="https://storybook.js.org/docs/react/addons/addon-types"
  115. target="_blank"
  116. >
  117. <img src={Plugin} alt="plugin" />
  118. <span>
  119. <strong>Presets for popular tools</strong>
  120. Easy setup for TypeScript, SCSS and more.
  121. </span>
  122. </a>
  123. <a
  124. className="link-item"
  125. href="https://storybook.js.org/docs/react/configure/webpack"
  126. target="_blank"
  127. >
  128. <img src={StackAlt} alt="Build" />
  129. <span>
  130. <strong>Build configuration</strong>
  131. How to customize webpack and Babel
  132. </span>
  133. </a>
  134. <a
  135. className="link-item"
  136. href="https://storybook.js.org/docs/react/configure/styling-and-css"
  137. target="_blank"
  138. >
  139. <img src={Colors} alt="colors" />
  140. <span>
  141. <strong>Styling</strong>
  142. How to load and configure CSS libraries
  143. </span>
  144. </a>
  145. <a
  146. className="link-item"
  147. href="https://storybook.js.org/docs/react/get-started/setup#configure-storybook-for-your-stack"
  148. target="_blank"
  149. >
  150. <img src={Flow} alt="flow" />
  151. <span>
  152. <strong>Data</strong>
  153. Providers and mocking for data libraries
  154. </span>
  155. </a>
  156. </div>
  157. <div className="subheading">Learn</div>
  158. <div className="link-list">
  159. <a className="link-item" href="https://storybook.js.org/docs" target="_blank">
  160. <img src={Repo} alt="repo" />
  161. <span>
  162. <strong>Storybook documentation</strong>
  163. Configure, customize, and extend
  164. </span>
  165. </a>
  166. <a className="link-item" href="https://storybook.js.org/tutorials/" target="_blank">
  167. <img src={Direction} alt="direction" />
  168. <span>
  169. <strong>In-depth guides</strong>
  170. Best practices from leading teams
  171. </span>
  172. </a>
  173. <a className="link-item" href="https://github.com/storybookjs/storybook" target="_blank">
  174. <img src={Code} alt="code" />
  175. <span>
  176. <strong>GitHub project</strong>
  177. View the source and add issues
  178. </span>
  179. </a>
  180. <a className="link-item" href="https://discord.gg/storybook" target="_blank">
  181. <img src={Comments} alt="comments" />
  182. <span>
  183. <strong>Discord chat</strong>
  184. Chat with maintainers and the community
  185. </span>
  186. </a>
  187. </div>
  188. <div className="tip-wrapper">
  189. <span className="tip">Tip</span>Edit the Markdown in{' '}
  190. <code>stories/Introduction.stories.mdx</code>
  191. </div>