x3388638 / react-grid-carousel

React responsive carousel component w/ grid layout
https://react-grid-carousel.now.sh
MIT License
128 stars 28 forks source link

Grid gap is provided also for the first and the last item in a row. How do you override that? #2

Open kingmaker9841 opened 3 years ago

x3388638 commented 3 years ago

Not really sure what do you mean. For default usage, it doesn't apply the gap to start of the first item and end of the last item, which will be like

截圖 2020-11-07 下午11 09 22

If you want to add some space for that, just add some margin to carousel item

截圖 2020-11-07 下午11 10 49

here is the example: https://63nui.csb.app/ https://codesandbox.io/s/quirky-forest-63nui?file=/src/App.js

bazw commented 3 years ago

I think this one might refer to the 20px margin on the far left and far right on one of the containers. I ran into that myself but have just offset it with a containerStyle on the main container: <Carousel cols={4} rows={2} containerStyle={{margin: '0 -20px'}}>

Great component @x3388638 works well thank you!

Charnchon commented 3 years ago

your comment saved me @bazw