@storybook/react#addParameters TypeScript Examples

The following examples show how to use @storybook/react#addParameters. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: preview.tsx    From ant-extensions with MIT License 6 votes vote down vote up
addParameters({
  options: {
    showRoots: true
  },
  docs: {
    container: (props: KeyValue) => (
      <DocsContainer
        {...props}
        context={{
          ...props.context,
          parameters: {
            ...props.context.parameters,
            options: { theme: useDarkMode() ? themes.dark : themes.light }
          }
        }}
      />
    )
  }
});
Example #2
Source File: config.ts    From substrate-api-explorer with Apache License 2.0 6 votes vote down vote up
// Add parameters
addParameters({
  options: {
    theme: themes.dark
  },
  backgrounds: [
    { name: 'White', value: '#FFFFFF' },
    { name: 'Black', value: '#000000' },
    { name: 'Primary', value: '#20E89B' },
    { name: 'Gray-100', value: '#B4AFD7' },
    { name: 'Gray-200', value: '#282446' },
    { name: 'Gray-300', value: '#201C3A' },
    { name: 'Gray-400', value: '#17142F', default: true },
    { name: 'Success', value: '#5ACA61' },
    { name: 'Warning', value: '#E29D16' },
    { name: 'Error', value: '#E01D28' },
    { name: 'Orange', value: '#FFAC81' },
    { name: 'Yellow', value: '#EFE9AE' },
    { name: 'Blue', value: '#59B5FF' }
  ]
})
Example #3
Source File: config.tsx    From natds-rn with ISC License 6 votes vote down vote up
addParameters({
  docs: {
    container: DocsContainer,
    page: DocsPageTemplate,
  },
  options: {
    enableShortcuts: true,
    isFullscreen: false,
    isToolshown: true,
    panelPosition: 'bottom',
    showNav: true,
    showPanel: true,
    sidebarAnimations: true,
  },
  theme: {
    themes: dsThemes,
  },
  viewport: {
    viewports: INITIAL_VIEWPORTS,
  },
});
Example #4
Source File: preview.ts    From grafana-chinese with Apache License 2.0 6 votes vote down vote up
addParameters({
  info: {},
  darkMode: {
    dark: GrafanaDark,
    light: GrafanaLight,
  },
  options: {
    showPanel: true,
    showRoots: true,
    panelPosition: 'bottom',
    showNav: true,
    isFullscreen: false,
    isToolshown: true,
    storySort: (a: any, b: any) => a[1].id.localeCompare(b[1].id),
  },
  knobs: {
    escapeHTML: false,
  },
});
Example #5
Source File: preview.tsx    From ant-extensions with MIT License 5 votes vote down vote up
// Theme Switcher
addParameters({
  darkMode: {
    light: { ...themes.light, brandTitle },
    dark: { ...themes.dark, brandTitle }
  }
});
Example #6
Source File: preview.tsx    From storefront with MIT License 5 votes vote down vote up
addParameters({
  layout: 'centered',
});
Example #7
Source File: preview.tsx    From react-hook-form-mui with MIT License 5 votes vote down vote up
addParameters({
  options: {
    storySort: (a: any, b: any) =>
      a[1].kind === b[1].kind ? 0 : a[1].id.localeCompare(b[1].id, undefined, { numeric: true })
  }
})