An input that returns a number value and automatically handles invalid inputs.
Installation
Copy and paste the component source files linked at the top of this page into your project.
Usage
<script lang="ts">
import { NumberInput, NumberInputGroup } from '$lib/components/number-input';
import * as InputGroup from '$lib/components/ui/input-group/index.js';
let value = $state<number | null>(null);
</script>
<NumberInput bind:value />
// Or
<InputGroup.Root>
<NumberInputGroup bind:value />
</InputGroup.Root>