infeng / react-viewer

react image viewer, supports rotation, scale, zoom and so on
https://infeng.github.io/react-viewer
MIT License
735 stars 137 forks source link

Can't change the styling of footer toolbar buttons #133

Open rhythm-3099 opened 3 years ago

rhythm-3099 commented 3 years ago

image Is it possible to somehow change the styling of the buttons. I want to change the styling of only the "test" button.

dearalina commented 2 years ago

Hope this could help : )


import Viewer from 'react-viewer';

const toolbar = [

// Change the style of buttons existed
  {
    key: 'zoomIn',
    actionType: 1,
    render: <CustomizedButton />,
  },
  {
    key: 'zoomOut',
    actionType: 2,
    render: <CustomizedButton />,
  },

// Set the style of buttons you created
  {
    key: 'customButton',
    render: <CustomizedButton />,
  },
];

<Viewer
  customToolbar={() => toolbar}
/>;