BibleChapterPicker is a compound component that provides an interface for selecting Bible books and chapters with search functionality and an accordion layout.
Basic Usage
Component Structure
BibleChapterPicker is a compound component with two parts:BibleChapterPicker.Root- Container that manages state and renders the popoverBibleChapterPicker.Trigger- Button to open the picker
Root Props
Bible version ID to load books from.
Controlled book ID (e.g., “GEN”, “JHN”).
Default book ID for uncontrolled mode.Default:
""Callback when book is selected.
Controlled chapter ID (e.g., “1”, “INTRO”).
Default chapter ID for uncontrolled mode.Default:
""Callback when chapter is selected.
Theme override.Default: Inherits from provider
Trigger Props
Whether to use the child element as the trigger.Default:
trueCustom trigger content or render function. The render function receives:
book: Current book IDchapter: Current chapter IDchapterLabel: Display label for chapter (e.g., “Intro”, “1”)currentBook: Full book objectloading: Loading state
Examples
Default Trigger
Custom Trigger
Uncontrolled Mode
Dark Theme
Features
Accordion Interface
- Expandable book list with chapter buttons
- Auto-scrolls to selected book when opened
- Smooth animations for expand/collapse
- Only one book expanded at a time
Search
- Real-time search by book name
- Case-insensitive filtering
- Search input at bottom of dialog
- Clears on selection
Intro Chapters
- Info icon button for books with intro chapters
- Proper labeling (“Intro” not “INTRO”)
- Selectable like regular chapters
Chapter Grid
- 5-column grid layout for chapter buttons
- Responsive sizing
- Visual feedback for selection
Auto-Scroll Behavior
- Scrolls to current book when dialog opens
- Smooth scroll animation
- Expands current book accordion
Accessibility
- Keyboard navigation
- ARIA labels and roles
- Focus management
- Screen reader support
Chapter Label Formatting
The picker formats chapter labels intelligently:Handling Special Chapters
Some versions include intro chapters:Styling
The picker uses:- Accordion with border separators
- 5-column grid for chapters
- Search input at bottom
- Scrollable content area
- Visual feedback for expanded state
Related Components
- BibleVersionPicker - Version selection
- BibleReader - Full reading experience
- BibleTextView - Verse display
