BibleVersionPicker is a compound component that provides a rich interface for selecting Bible versions with language filtering, search functionality, and recently used versions.
Basic Usage
Component Structure
BibleVersionPicker is a compound component with three parts:BibleVersionPicker.Root- Container that manages stateBibleVersionPicker.Trigger- Button to open the pickerBibleVersionPicker.Content- The picker dialog content
Root Props
Currently selected version ID.
Callback when version is selected.
Theme override.Default: Inherits from provider
Position of the popover relative to the trigger.Default:
"top"Trigger Props
Whether to use the child element as the trigger.Default:
trueCustom trigger content or render function. The render function receives:
version: Current version objectloading: Loading state
Examples
Default Trigger
Custom Trigger
Render Function
Dark Theme
Custom Position
Features
Language Filtering
- Suggested tab shows regional and browser-preferred languages
- All tab shows alphabetically sorted languages
- Language count badge shows available versions
- Displays language names in English and native script
Search
- Real-time search across version titles and abbreviations
- Filters both recent and all versions
- Search resets when dialog closes or version is selected
Recent Versions
- Automatically tracks last 3 selected versions
- Stored in localStorage:
youversion-platform:picker:recent-versions - Recent versions shown at top when present
- Filtered by search query
Version Abbreviation Icons
- Auto-scaling abbreviation display
- Splits version codes (e.g., “KJV2” → “KJV” + “2”)
- Responsive font sizing to fit container
Accessibility
- Keyboard navigation
- ARIA labels and roles
- Focus management
- Screen reader support
Persistence
Recent versions are stored in localStorage:- Loads recent versions on mount
- Saves selected versions
- Maintains max of 3 recent versions
- Moves selected version to top of list
Styling
The picker displays:- Version icons with auto-scaled abbreviations
- Selected version with
yv:bg-mutedbackground - Language tabs with version count
- Searchable version list
- Loading states during API calls
Related Components
- BibleChapterPicker - Chapter selection
- BibleReader - Full reading experience
- BibleCard - Embeddable passage card
