Skip to content

Instantly share code, notes, and snippets.

@mhsattarian
Created February 25, 2024 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhsattarian/616c8fea5feb30aaa31b323c10e94995 to your computer and use it in GitHub Desktop.
Save mhsattarian/616c8fea5feb30aaa31b323c10e94995 to your computer and use it in GitHub Desktop.
A Radix Carousel component styled via PandaCSS
@mhsattarian
Copy link
Author

mhsattarian commented Feb 25, 2024

usage example:

<Carousel>
      <CarouselSlideList
        className={flex({
          w: 'full',
          direction: 'row',
          gap: 3,
        })}
      >
        <Breadcrumb
          spacing={3}
          fontWeight='light'
          whiteSpace='nowrap'
          separator={<ChevronLeftIcon color='gray.500' />}
        >
          {steps.map((s, idx) => {
            const isCurrentPage = idx === currentPageIndex;
            return (
              <BreadcrumbItem
                key={idx}
                isCurrentPage={isCurrentPage}
                whiteSpace='nowrap'
              >
                <CarouselSlide>
                  <BreadcrumbLink
                    as={!isCurrentPage ? NextLink : 'span'}
                    href={s.link}
                    aria-current={isCurrentPage ? 'page' : undefined}
                  >
                    {s.title}
                  </BreadcrumbLink>
                </CarouselSlide>
              </BreadcrumbItem>
            );
          })}
        </Breadcrumb>
      </CarouselSlideList>
    </Carousel>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment