@jamthebest/bible-verse-selector
v0.2.1
Published
Bible verse selector core utilities and React component.
Readme
@jamthebest/bible-verse-selector
Bible verse selection utilities and a React picker component.
Repository
https://github.com/jamthebest/bible-verse-selector
Playground
The playground runs a small Vite app from examples/playground using the published npm package.
Install
npm install @jamthebest/bible-verse-selectorReact usage
import { BibleVerseSelector } from '@jamthebest/bible-verse-selector/react';
export function App() {
return (
<BibleVerseSelector
allowRange
language="system"
theme="system"
onRealChange={(selection, formatted) => {
console.log(selection, formatted);
}}
/>
);
}language accepts system, es, or en.
theme accepts system, light, or dark.
onChange(selection, formatted) fires on every intermediate picker step.
onRealChange(selection, formatted) fires once when the picker dialog closes after a selection
change.
Core usage
import { formatSelection, labelsEs } from '@jamthebest/bible-verse-selector';
const formatted = formatSelection(
{ kind: 'verse', ref: { book: 'PSA', chapter: 1, verse: 1 } },
labelsEs,
);License
MIT
