MCPcopy Create free account
hub / github.com/better-auth/examples / CarouselNext

Function CarouselNext

astro-example/src/components/ui/carousel.tsx:230–272  ·  view source on GitHub ↗
(
	props: VoidProps<ComponentProps<typeof Button>>,
)

Source from the content-addressed store, hash-verified

228};
229
230export const CarouselNext = (
231 props: VoidProps<ComponentProps<typeof Button>>,
232) => {
233 const merge = mergeProps<VoidProps<ComponentProps<typeof Button>[]>>(
234 { variant: "outline", size: "icon" },
235 props,
236 );
237 const [local, rest] = splitProps(merge, ["class", "variant", "size"]);
238 const { orientation, scrollNext, canScrollNext } = useCarousel();
239
240 return (
241 <Button
242 variant={local.variant}
243 size={local.size}
244 class={cn(
245 "absolute h-8 w-8 touch-manipulation rounded-full",
246 orientation === "horizontal"
247 ? "-right-12 top-1/2 -translate-y-1/2"
248 : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
249 local.class,
250 )}
251 disabled={!canScrollNext()}
252 onClick={scrollNext}
253 {...rest}
254 >
255 <svg
256 xmlns="http://www.w3.org/2000/svg"
257 viewBox="0 0 24 24"
258 class="size-4"
259 >
260 <path
261 fill="none"
262 stroke="currentColor"
263 strokeLinecap="round"
264 strokeLinejoin="round"
265 strokeWidth="2"
266 d="M5 12h14m-4 4l4-4m-4-4l4 4"
267 />
268 <title>Next slide</title>
269 </svg>
270 </Button>
271 );
272};

Callers

nothing calls this directly

Calls 2

cnFunction · 0.90
useCarouselFunction · 0.70

Tested by

no test coverage detected