@mpen/react-basic-inputs

@mpen/react-basic-inputs

Thin wrappers around native input elements to make them behave better.

bun add --dev @mpen/react-basic-inputs
# or
yarn add @mpen/react-basic-inputs
# or
npm install @mpen/react-basic-inputs

Like <select> but takes an options prop instead of children.

  • The values are typed; they can be anything, not just string
  • Duplicate values are OK. e.g. if you want to put "United States" at the top of your country list and then again in alphabetical order, it will just work
  • Each <option> will automatically be assigned a unique React key
  • If the current value cannot be found in the list of options it will be appended to the end
    • If you want to override this behavior, set invalidValueOption
  • placeholder prop