一键导入
groww-carousel
Carousel component for image/content sliders with navigation controls. Use for image galleries, hero sections, or content that scrolls horizontally.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Carousel component for image/content sliders with navigation controls. Use for image galleries, hero sections, or content that scrolls horizontally.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Accordion component with collapsible sections. Use for FAQs, nested content, or expandable details sections.
Button component with variants, sizes, loading states, and icon support. Use when creating clickable actions, forms, or navigation buttons.
Calendar component for date and month selection. Use when building date pickers, scheduling interfaces, or date range selectors.
Checkbox component for boolean or multi-select inputs. Use when building forms with boolean toggles or multiple selection lists.
Dropdown menu component with trigger and content pattern. Use when building selectable menus, action menus, or nested navigation.
Icon-only button component for actions. Use for toolbars, navigation bars, or compact action buttons without text.
| name | groww-carousel |
| description | Carousel component for image/content sliders with navigation controls. Use for image galleries, hero sections, or content that scrolls horizontally. |
import Carousel from '@groww-tech/ui-toolkit/dist/esm/components/molecules/Carousel';
import FlatCarousel from '@groww-tech/ui-toolkit/dist/esm/components/molecules/FlatCarousel';
// or
import { Carousel, FlatCarousel } from '@groww-tech/ui-toolkit';
interface CarouselProps {
children?: React.ReactNode; // Slide content
dots?: boolean; // Show navigation dots
arrows?: boolean; // Show arrow buttons
infinite?: boolean; // Infinite loop
autoplay?: boolean; // Auto-play slides
autoplaySpeed?: number; // Auto-play interval (ms)
speed?: number; // Animation speed (ms)
slidesToShow?: number; // Visible slides
slidesToScroll?: number; // Slides per scroll
centerMode?: boolean; // Center current slide
responsive?: Array<{ // Responsive breakpoints
breakpoint: number;
settings: {
slidesToShow: number;
slidesToScroll: number;
};
}>;
className?: string;
dataTestId?: string;
}
interface FlatCarouselImage {
src: string; // Image URL (required)
darkSrc?: string; // Dark mode image URL
alt: string; // Alt text (required)
width?: number | string;
height?: number | string;
title?: string; // Image title
description?: string; // Image description
titleClass?: string;
descriptionClass?: string;
}
interface FlatCarouselProps {
images: FlatCarouselImage[]; // Array of images (required)
parentClass?: string;
descriptionClass?: string;
titleClass?: string;
custom?: boolean; // Custom styling
dataTestId?: string;
}
<Carousel arrows={true} dots={true}>
<div><img src="/slide1.jpg" alt="Slide 1" /></div>
<div><img src="/slide2.jpg" alt="Slide 2" /></div>
<div><img src="/slide3.jpg" alt="Slide 3" /></div>
</Carousel>
<Carousel
autoplay={true}
autoplaySpeed={5000}
arrows={false}
dots={true}
>
{slides.map(slide => (
<div key={slide.id}>{slide.content}</div>
))}
</Carousel>
<Carousel
slidesToShow={3}
slidesToScroll={1}
infinite={true}
>
{products.map(product => (
<ProductCard key={product.id} product={product} />
))}
</Carousel>
<Carousel
slidesToShow={1}
responsive={[
{
breakpoint: 768,
settings: {
slidesToShow: 2,
slidesToScroll: 2,
},
},
{
breakpoint: 1024,
settings: {
slidesToShow: 3,
slidesToScroll: 3,
},
},
]}
>
{items.map(item => <Item key={item.id} {...item} />)}
</Carousel>
const images = [
{
src: '/hero1.jpg',
darkSrc: '/hero1-dark.jpg',
alt: 'Banner 1',
title: 'Summer Sale',
description: 'Up to 50% off',
},
{
src: '/hero2.jpg',
darkSrc: '/hero2-dark.jpg',
alt: 'Banner 2',
title: 'New Arrivals',
description: 'Check out the latest',
},
];
<FlatCarousel images={images} />