Skip to main content

BlazeSlider Props Reference

Full prop tables for every sub-component. Types live in app/components/BlazeSlider/lib/types.d.ts. For usage patterns see Simple + Composable Mode.


BlazeSliderโ€‹

The root component. Accepts BlazeSliderConfig + either simple-mode or composable-mode props. All BlazeSliderConfig props apply in both modes.

BlazeSliderConfig โ€” layout & behaviorโ€‹

PropTypeDefaultDescription
slidesToShownumber1Slides visible in the viewport at once.
slidesToScrollnumber1Slides advanced per prev/next press. Setting this > 1 means slider.next(N) / slider.prev(N) advance by states, not slides โ€” affects initialSlide mapping (see hook.md).
slideGapstring'12px'Gap between slides โ€” any CSS length unit (px, rem, %).
minSlideWidthstringโ€”Optional floor on each slide's width. When set, buildScopedCSS overrides --slide-width to this value and sizes slides to width: max-content; min-width: <floor>. Use for tight strips (e.g. a color bar) where a long label should widen its own slide rather than be clipped. Don't use on product carousels โ€” blaze snaps by --slide-width so dragging drifts when slides are max-content width.
loopbooleanfalseInfinite loop โ€” wraps the track by physically reordering DOM nodes. isAtStart / isAtEnd are always false in loop mode (buttons are never disabled).
draggablebooleantrueEnable drag/swipe gestures.
initialSlidenumber0Zero-based index of the slide to show on mount. Navigates instantly (no transition). Set slidesToScroll: 1 if you need 1:1 index mapping โ€” slider.next(N) advances by states, so initialSlide: 3 with slidesToScroll: 5 would jump 15 slides.
onSlideChange(activeIndex: number) => voidโ€”Fires after each slide transition with the new active (leftmost-visible) index.
breakpointsRecord<string, MediaConfig>โ€”Responsive overrides keyed by media query string. Each value is a MediaConfig that accepts any subset of the layout props above. Applied in CSS cascade order โ€” mobile-first or desktop-first both work. See blaze-slider docs for advanced targets (orientation, reduced-motion, etc.).
enableAutoplaybooleanfalseAuto-advance slides on an interval.
autoplayIntervalnumber3000Milliseconds between auto-advances. Only relevant when enableAutoplay is true.
stopAutoplayOnInteractionbooleanfalsePermanently stop autoplay after the first user interaction.
pauseAutoplayOnHoverbooleantruePause autoplay on mouseenter / focusin, resume on mouseleave / focusout.
transitionDurationnumber500Slide transition duration in milliseconds.
transitionTimingFunctionstring'ease'CSS easing for the transition. Accepts 'ease', 'linear', or any cubic-bezier(...) string.

Shared layout propsโ€‹

PropTypeDefaultDescription
headingTitlestring'Carousel'Screen-reader heading for the carousel region (aria-labelledby). Rendered as a visually-hidden <p>.
headingRolenumberโ€”When provided, adds role="heading" + aria-level={headingRole} to the heading element. Range 1โ€“6. Match the surrounding heading hierarchy.
containerClassnamestringโ€”Classes applied to the inner blaze-container div (the direct parent of buttons + track).
classNamestringโ€”Classes on the outermost carousel <div>.
styleCSSPropertiesโ€”Inline styles on the outermost <div>.

Simple-mode-only propsโ€‹

Only valid when slides + slideRenderer are passed (simple mode).

PropTypeDefaultDescription
slidesReadonlyArray<T>requiredData items โ€” one BlazeSlide is generated per entry.
slideRenderer(item: T, index: number) => ReactNoderequiredRender function for each item. Does not receive isVisible โ€” drop into composable + BlazeTrack renderer mode if you need it.
hideButtonsbooleanfalseHides prev/next buttons visually but keeps them keyboard-focusable (opacity-0, pointer-events-none, revealed on focus). Use instead of display:none to preserve keyboard accessibility.
buttonPropsSimpleButtonPropsโ€”Forwarded to both prev + next BlazeButton instances. Accepts any BlazeButtonProps except direction (set internally).
trackPropsSimpleTrackPropsโ€”Forwarded to BlazeTrack. Accepts any BlazeTrackProps except enableAutoplay and children (set internally).
slidePropsSimpleSlidePropsโ€”Forwarded to every generated BlazeSlide. Accepts any BlazeSlideProps except index and children (set internally).

BlazeTrackโ€‹

Renders the .blaze-track-container + .blaze-track DOM nodes that blaze-slider requires. Supports two sub-modes selected at runtime by the presence of slideRenderer.

PropTypeDefaultDescription
classNamestringโ€”Classes on the outer .blaze-track-container div. Use for horizontal inset (e.g. mx-2 md:mx-6) so buttons can overlap the track edge.
staticClassnamestringโ€”Classes applied to .blaze-track only when isStatic is true (i.e. total slides โ‰ค slidesToShow). Use to center a short list that doesn't fill the track.
enableAutoplaybooleanfalseWhen true, sets aria-live="off" to suppress noisy screen-reader announcements during auto-advance. Match this to BlazeSlider's enableAutoplay.

Children mode โ€” pass <BlazeSlide> nodes directly as children. Full composition control but you manage keys and slide rendering yourself.

Renderer mode โ€” pass items + slideRenderer. BlazeTrack maps items to <BlazeSlide> and resolves isVisible from context on your behalf, so you don't need a wrapper component just to read the provider.

Renderer-mode propTypeDefaultDescription
itemsReadonlyArray<T>โ€”Items to map into slides.
slideRenderer(item: T, index: number, isVisible: boolean) => ReactNodeโ€”Render function. isVisible is visibleIndices.has(index) โ€” use it to set tabIndex on interactive slide content.
getSlideKey(item: T, index: number) => React.KeyindexStable key getter. Always provide this to avoid [object Object] keys when items are objects.
slidePropsPartial<Omit<BlazeSlideProps, 'index' | 'children'>>โ€”Props forwarded to every generated BlazeSlide (e.g. className, tag).

BlazeSlideโ€‹

Wraps each slide's content. Intentionally never re-renders on context changes โ€” visibility, aria-hidden, and tabIndex are managed via direct DOM writes in syncSlideDOM. Do not make this component read BlazeSlideContext.

PropTypeDefaultDescription
indexnumberrequiredPosition in the track. Used as data-slide-index so blaze-slider and syncSlideDOM can locate this slide. Must be stable and match the item's array position.
tagkeyof JSX.IntrinsicElements'div'HTML element to render as the slide root. Use tag="li" when the track is a <ul>, tag="article" for content cards, etc.
classNamestringโ€”Additional classes on the slide root. [content-visibility:auto] is always applied โ€” don't remove it.
childrenReactNodeโ€”Slide content.

BlazeButtonโ€‹

prev / next navigation button. Reads slider state from BlazeSlideContext โ€” must be placed inside a <BlazeSlider> but outside <BlazeTrack>. Returns null when isStatic (no navigation needed).

PropTypeDefaultDescription
direction'prev' | 'next'requiredWhich direction this button navigates. Controls aria-label and rotation (next button rotates 180ยฐ).
chevronSizenumber16Width and height of the icon in px.
type'default' | 'arrow''default'Icon variant. 'default' uses ChevronIcon; 'arrow' uses CarouselArrow (a longer directional arrow).
iconColorstringโ€”Color passed to the icon SVG. Defaults to currentColor.
disablePositioningbooleanfalseWhen false (default), applies absolute top-1/2 -translate-y-1/2 left-0/right-0 so buttons float over the track. Set true when you want to position buttons manually (e.g. inside a flex row above the track).
hideButtonsbooleanfalseVisually hides the button (opacity-0, pointer-events-none) while keeping it keyboard-focusable. Mirrors the simple-mode hideButtons prop for composable usage.
onClick() => voidโ€”Fires before the slide transition. Use for side effects (e.g. pausing a video).
analyticsEventCustomAnalyticsEventโ€”Analytics event key to publish on click via Hydrogen's useAnalytics().publish().
getAnalyticsData(direction: 'prev' | 'next') => Record<string, unknown>โ€”Returns the customData payload published with analyticsEvent. Receives the button's direction so one handler can serve both buttons.

CarouselCounterโ€‹

Optional 1 / N slide indicator. Reads currentIndex and total from context โ€” must be inside a <BlazeSlider>. No required props beyond totalSlides.

PropTypeDefaultDescription
totalSlidesnumberrequiredTotal slide count. Used to render the denominator.
classNamestringโ€”Classes on the counter wrapper.

Breakpoint shape (MediaConfig)โ€‹

Each value in the breakpoints record accepts any layout prop that can differ per viewport:

type MediaConfig = {
slidesToShow?: number;
slidesToScroll?: number;
slideGap?: string;
loop?: boolean;
enableAutoplay?: boolean;
autoplayInterval?: number;
transitionDuration?: number;
transitionTimingFunction?: string;
};

Keys are standard media query strings โ€” '(min-width: 768px)', '(orientation: landscape)', '(prefers-reduced-motion: reduce)', etc. Applied in cascade order: later matches override earlier ones.

breakpoints={{
'(min-width: 768px)': { slidesToShow: 4, slidesToScroll: 3 },
'(min-width: 1280px)': { slidesToShow: 6, slidesToScroll: 5 },
}}