Matterway
    Preparing search index...

    Function docViewer

    • Doc viewer component for displaying doc contents alongside a sidebar.

      Parameters

      • props: DocViewerProps

        Configuration object

        • items

          Array of items to display in the doc viewer

        • sidebar

          React node to be displayed as the sidebar

        • buttons

          Optional array of button list items to display in the navigation bar

        • collapsed

          Optional boolean to control the initial collapsed state of the sidebar

        • description

          Optional description text to display in the header

        • isCollapsible

          Optional boolean to control whether the sidebar can be collapsed

        • title

          Optional title text to display in the header

      Returns Element

      Basic usage with buttons and items:

      docViewer({
      buttons: [
      { text: 'Action 1', value: 'action1' },
      { text: 'Action 2', value: 'action2' },
      ],
      collapsed: false,
      description: 'This is a doc viewer',
      items: [
      {
      title: 'example.jpg',
      subtitle: '15 KB',
      filetype: 'image',
      src: 'data:image/jpeg;base64,...',
      },
      ],
      isCollapsible: true,
      sidebar: <div>Sidebar content</div>,
      title: 'Document Viewer',
      });