Introduction.stories.mdx 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. import { Meta } from '@storybook/addon-docs';
  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: 900;
  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 30px 20px 15px;
  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. font-size: 14px;
  76. line-height: 20px;
  77. }
  78. .tip {
  79. display: inline-block;
  80. border-radius: 1em;
  81. font-size: 11px;
  82. line-height: 12px;
  83. font-weight: 700;
  84. background: #E7FDD8;
  85. color: #66BF3C;
  86. padding: 4px 12px;
  87. margin-right: 10px;
  88. vertical-align: top;
  89. }
  90. .tip-wrapper {
  91. font-size: 13px;
  92. line-height: 20px;
  93. margin-top: 40px;
  94. margin-bottom: 40px;
  95. }
  96. .tip-wrapper code {
  97. font-size: 12px;
  98. display: inline-block;
  99. }
  100. `}
  101. </style>
  102. # Welcome to Storybook
  103. Storybook helps you build UI components in isolation from your app's business logic, data, and context.
  104. That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA.
  105. Browse example stories now by navigating to them in the sidebar.
  106. View their code in the `stories` directory to learn how they work.
  107. We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages.
  108. <div className="subheading">Configure</div>
  109. <div className="link-list">
  110. <a
  111. className="link-item"
  112. href="https://storybook.js.org/docs/react/addons/addon-types"
  113. target="_blank"
  114. >
  115. <img src={Plugin} alt="plugin" />
  116. <span>
  117. <strong>Presets for popular tools</strong>
  118. Easy setup for TypeScript, SCSS and more.
  119. </span>
  120. </a>
  121. <a
  122. className="link-item"
  123. href="https://storybook.js.org/docs/react/configure/webpack"
  124. target="_blank"
  125. >
  126. <img src={StackAlt} alt="Build" />
  127. <span>
  128. <strong>Build configuration</strong>
  129. How to customize webpack and Babel
  130. </span>
  131. </a>
  132. <a
  133. className="link-item"
  134. href="https://storybook.js.org/docs/react/configure/styling-and-css"
  135. target="_blank"
  136. >
  137. <img src={Colors} alt="colors" />
  138. <span>
  139. <strong>Styling</strong>
  140. How to load and configure CSS libraries
  141. </span>
  142. </a>
  143. <a
  144. className="link-item"
  145. href="https://storybook.js.org/docs/react/get-started/setup#configure-storybook-for-your-stack"
  146. target="_blank"
  147. >
  148. <img src={Flow} alt="flow" />
  149. <span>
  150. <strong>Data</strong>
  151. Providers and mocking for data libraries
  152. </span>
  153. </a>
  154. </div>
  155. <div className="subheading">Learn</div>
  156. <div className="link-list">
  157. <a className="link-item" href="https://storybook.js.org/docs" target="_blank">
  158. <img src={Repo} alt="repo" />
  159. <span>
  160. <strong>Storybook documentation</strong>
  161. Configure, customize, and extend
  162. </span>
  163. </a>
  164. <a className="link-item" href="https://storybook.js.org/tutorials/" target="_blank">
  165. <img src={Direction} alt="direction" />
  166. <span>
  167. <strong>In-depth guides</strong>
  168. Best practices from leading teams
  169. </span>
  170. </a>
  171. <a className="link-item" href="https://github.com/storybookjs/storybook" target="_blank">
  172. <img src={Code} alt="code" />
  173. <span>
  174. <strong>GitHub project</strong>
  175. View the source and add issues
  176. </span>
  177. </a>
  178. <a className="link-item" href="https://discord.gg/storybook" target="_blank">
  179. <img src={Comments} alt="comments" />
  180. <span>
  181. <strong>Discord chat</strong>
  182. Chat with maintainers and the community
  183. </span>
  184. </a>
  185. </div>
  186. <div className="tip-wrapper">
  187. <span className="tip">Tip</span>Edit the Markdown in{' '}
  188. <code>stories/Introduction.stories.mdx</code>
  189. </div>