Closed jacomyal closed 2 years ago
1) Every "button" can be customized by passing children element to the control. Example :
<FullScreenControl>
<>
<BsArrowsFullscreen />
<BsFullscreenExit />
</>
</FullScreenControl>
2) All control component are really easy to re-implement, all the logic are done in hooks that are exposed by the library
I am right now trying to integrate react-sigma-v2 in a Bootstrap based application, and the
custom-buttons
example does not quite fit: https://github.com/sim51/react-sigma-v2/blob/e4c0ff5e936e04c2d7da1e16893512a8923a65d8/examples/custom-buttons.tsx#L62-L68I can't simply give a custom class to the button (
"btn btn-outline-dark"
with Bootstrap, for instance), because the class goes to the parent. And it's not that bad for the zoom / fullscreen buttons since they are based on very usable and simple hooks (even if I think they should be more visible in the examples), but theSearchControl
is quite unusable for me and I end up copying the whole source in my app...I think most web developers using React have, one way or another, some constraints on their markup and/or CSS (internal constraints or framework constraints), and covering those constraints with some custom props will never be good enough. As a user, I really would prefer a well designed suite of hooks to enables those features. And I'm sure exposing components with basic default markups for other users is acceptable, but should be considered secondary.
A good inspiration for this is react-dropzone for instance.