01 / INTERFACE REVIEW
Keyboard review
Keep the interaction clear, including the way back.
Native scrolling with explicit slide controls and accessible rotation.
npx shadcn@latest add https://ui.bld8.dev/r/carousel.jsonRegistry setup · Examples · API and behavior · Open the playground
COMPLETE EXAMPLES
Each example includes its imports, data and state. The preview runs that same source. Include the stylesheet once in your application.
Touch, trackpad and keyboard navigation share a native scroll region. Automatic rotation is opt-in and pauses for interaction or reduced motion.
Install this complete example and its component dependencies.
npx shadcn@latest add https://ui.bld8.dev/r/example-carousel-native-controls.json/*!
MIT License
Copyright (c) 2026 Jaison
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
'use client';
import '@bld8/ui/styles.css';
import {useState} from 'react';
import {Button,Carousel,Checkbox} from '@bld8/ui';
export default function ReviewCarousel(){const [auto,setAuto]=useState(false),[result,setResult]=useState('No review opened.');return <section><Checkbox label="Enable automatic rotation" checked={auto} onCheckedChange={setAuto}/><div style={{marginTop:20}}><Carousel label="Review stories" autoplay={auto?3000:undefined} items={['Keyboard','Spacing','Recovery'].map((title,index)=>({id:title.toLowerCase(),label:title+' review',content:<article style={{padding:28,minHeight:240,background:index===0?'var(--bui-selected-bg)':'var(--bui-surface)',borderRadius:8}}><p className="bui-hint">0{index+1} / INTERFACE REVIEW</p><h3>{title} review</h3><p>Keep the interaction clear, including the way back.</p><Button variant="secondary" onClick={()=>setResult(title+' review opened in this local example.')}>Review {title.toLowerCase()}</Button></article>}))}/></div><p role="status">{result}</p></section>;}
<Carousel label="Product views" items={items} />In the workspace or ZIP starter, import components from @bld8/ui and include @bld8/ui/styles.css once. Registry installations use your local bld8/ source path. Wrap overlays in UIProvider.
Up to 20 stable labelled slides. Touch and trackpad scrolling remain native; keyboard and Previous/Next controls retain focus. Autoplay is opt-in, pausable and respects focus, visibility and reduced motion.
| Prop | Type | Default |
|---|---|---|
itemsRequired | readonly CarouselItem[] | — |
labelRequired | string | — |
autoplay | number | undefined | — |
className | string | undefined | — |
defaultIndex | number | undefined | 0 |
onIndexChange | ((index: number) => void) | undefined | — |
| Prop | Type | Default |
|---|---|---|
itemsRequired | readonly CarouselItem[] | — |
labelRequired | string | — |
autoplay | number | undefined | — |
className | string | undefined | — |
defaultIndex | number | undefined | — |
onIndexChange | ((index: number) => void) | undefined | — |
| Prop | Type | Default |
|---|---|---|
contentRequired | ReactNode | — |
idRequired | string | — |
labelRequired | string | — |
Tables come from the public TypeScript declarations. Related types and function parameters are shown alongside their component. A dash means no default is declared at the public function boundary.
Test this component with real content, keyboard input and both themes. The example is a starting point; labels, error handling and behaviour still need to fit the application.