value: ""
Install
npm i reed-hunt-input
React
import { ReedHuntInput, reedHuntFormats } from 'reed-hunt-input/react';
const [card, setCard] = useState('');
<ReedHuntInput
format={reedHuntFormats.card}
value={card}
onValueChange={setCard}
/>
Vue
import { ReedHuntInput, reedHuntFormats } from 'reed-hunt-input/vue';
<ReedHuntInput
v-model="pin"
:format="reedHuntFormats.pin"
@complete="unlock"
/>
Plain JS
import { createReedHunt, reedHuntFormats } from 'reed-hunt-input';
createReedHunt(document.querySelector('#amount'), {
format: reedHuntFormats.amount,
onChange: (digits) => console.log(digits),
});
Your styles
Built-in styles sit in a cascade layer, so plain CSS like this wins without a fight.
.soft {
--rh-accent: #7c3aed;
--rh-accent-soft: #ede9fe;
--rh-radius: 12px;
--rh-stage-border: 0;
--rh-stage-shadow: 0 12px 32px rgb(76 29 149 / 0.25);
--rh-font-mono: 'Inter', sans-serif;
}
.soft .rh-slot[data-state='filled'] {
border-color: #7c3aed;
background: #f5f3ff;
}
createReedHunt(el, {
format: reedHuntFormats.pin,
classNames: { root: 'soft' },
});