storybook/docs/configure/features-and-behavior.md
2020-08-03 22:15:39 +01:00

2.5 KiB
Raw Blame History

title
Features and behavior

To control the layout of Storybooks UI you can use the setConfig addons API in your .storybook/manager.js:

import { addons } from '@storybook/addons';

addons.setConfig({
  isFullscreen: false,
  showNav: true,
  showPanel: true,
  panelPosition: 'bottom',
  sidebarAnimations: true,
  enableShortcuts: true,
  isToolshown: true,
  theme: undefined,
  selectedPanel: undefined,
  initialActive: 'sidebar',
  showRoots: false,
});

The following table details how to use the API values:

Name Type Description Example Value
isFullscreen Boolean Show story component as full screen false
showNav Boolean Display panel that shows a list of stories true
showPanel Boolean Display panel that shows addon configurations true
panelPosition String/Object Where to show the addon panel bottom or `{('bottom'
sidebarAnimations Boolean Sidebar tree animations true
enableShortcuts Boolean Enable/disable shortcuts true
isToolshown String Show/hide tool bar true
theme Object Storybook Theme, see next section undefined
selectedPanel String Id to select an addon panel my-panel
initialActive String Select the default active tab on Mobile. 'sidebar' or `{('sidebar'
showRoots Boolean Display the top-level grouping as a "root" in the sidebar false