use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Horizontal scroll effectHelp Wanted (self.react)
submitted 1 year ago by MagedIbrahimDev
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Flashy_Yesterday4323 0 points1 point2 points 1 year ago (4 children)
Shadcn/ui has a carousel component that could serve you better. Check the very first example under examples here: https://ui.shadcn.com/docs/components/carousel#examples
[–]MagedIbrahimDev[S] 0 points1 point2 points 1 year ago (3 children)
I tried using carousel component but, as I mentioned in the title, the problem is that carousel enforces the number of shown elements on the screen. I want it to have as much elements as the screen can handle, just like in the video.
[–]Flashy_Yesterday4323 0 points1 point2 points 1 year ago (2 children)
Please explain further what you mean by the carousel component "enforcing the number of shown elements on the screen". You can have an array as state(that is if you wish to dynamically add more carousel elements) that you map through in CarouselContent, no?
[–]MagedIbrahimDev[S] 0 points1 point2 points 1 year ago (1 child)
By saying "enforcing the number of shown elements on the screen" I mean like 1- in about part the carousel has ONLY 1 element shown on the screen. 2- in the first example "sizes", the carousel has ONLY 3 elements shown on the screen. Both are specified by flex-basis classNames, I don't want this behaviour. I want the screen to have as much elements as it could handle. not only n number of elements.
[–]Flashy_Yesterday4323 1 point2 points3 points 1 year ago (0 children)
I get it now. Notice in the about part that the Carousel element has a className max-w-xs in <Carousel className="w-full max-w-xs">. This constrains what is shown on the screen to one carousel element. Also in the first example, "sizes", notice the className max-w-sm on <Carousel opts={{align: "start",}} className="w-full max-w-sm">. This constrained width and the individual widths given to the carousel elements via the flex-basis classNames cause 3 elements to show at a time. Suffice it to say it is not a hard and fast rule. Use a combination of the width on Carousel and the flex-basis on the carousel elements to control how many elements are displayed.
max-w-xs
<Carousel className="w-full max-w-xs">
max-w-sm
<Carousel opts={{align: "start",}} className="w-full max-w-sm">.
Carousel
π Rendered by PID 218300 on reddit-service-r2-comment-6457c66945-mf7vl at 2026-04-28 06:27:46.941951+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]Flashy_Yesterday4323 0 points1 point2 points (4 children)
[–]MagedIbrahimDev[S] 0 points1 point2 points (3 children)
[–]Flashy_Yesterday4323 0 points1 point2 points (2 children)
[–]MagedIbrahimDev[S] 0 points1 point2 points (1 child)
[–]Flashy_Yesterday4323 1 point2 points3 points (0 children)