react-pdf-viewer v2.6.0 Release Notes

  • ๐Ÿ’… From this version, all the components use the BEM naming convention for CSS classes. So if you override the styles of given class, you need to change the class.

    ๐Ÿ“ฆ The CSS classes are named as rpv-PACKAGE__COMPONENT, rpv-PACKAGE__COMPONENT--STATE. For example:

    /* Old version */
    .rpv-search-highlight {
        ...;
    }
    .rpv-search-highlight-current {
        ...;
    }
    
    /* From v2.6.0 */
    .rpv-search__highlight {
        ...;
    }
    .rpv-search__highlight--current {
        ...;
    }
    

    ๐Ÿ†• New features

    • ๐Ÿ“ฆ The core package provides new TextBox component
    • ๐Ÿ‘ Support themes. You can create a custom theme with new theme option:
    <Viewer theme="bootstrap" />
    

    ๐Ÿ”Œ The main viewer then will have the class rpv-core__viewer--bootstrap. You can set the value for CSS variables which are provided by plugins:

    .rpv-core__viewer--bootstrap {
        /* Custom the background color of toolbar in the default layout */
        --rpv-default-layout__toolbar-background-color: #eee;
    }
    

    The following built-in themes are provided:

    Theme ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  Description
    <Viewer theme='auto' /> Switch to the dark or light mode automatically based on the system setting
    <Viewer theme='dark' /> The dark theme
    0๏ธโƒฃ <Viewer theme='light' />
    0๏ธโƒฃ <Viewer theme='' />
    • ๐Ÿ”Œ Add new theme plugin that provides components for switching between the dark and light themes
    • The toolbar Slot has new SwitchTheme and SwitchThemeMenuItem

    ๐Ÿ‘Œ Improvements

    • Tweak toggle icons in bookmark items
    • ๐Ÿ”Œ The bookmark plugin provide new icons: DownArrowIcon and RightArrowIcon
    • ๐Ÿ”Œ Improve text selection in the highlight plugin
    • ๐Ÿ”Œ You can enable or disable shortcuts in the print and zoom plugins:
    const printPluginInstance = printPlugin({
        // The shortcuts are enabled by default
        enableShortcuts: false,
    });
    
    const zoomPluginInstance = zoomPlugin({
        // The shortcuts are enabled by default
        enableShortcuts: false,
    });
    

    ๐Ÿ› Bug fixes

    • Can't close popovers after scrolling
    • ๐Ÿ–จ Can't open any popover after printing
    • Icons in menu items aren't centered horizontally
    • ๐Ÿ‘ป There is an exception when jumping to the next or previous match if the keyword isn't found

    ๐Ÿ’ฅ Breaking change

    • ๐Ÿ”Œ The toolbar plugin doesn't include the drop plugin anymore. In order to use the drop plugin, you have to register it
    • Button is renamed to MinimalButton
    • ๐Ÿšš The option prefixClass is removed