webflow svelte components logoWFS

Unit input

Form field for numerical values.

Usage

<script lang="ts">
  import { UnitInput } from '$lib/components/input';
</script>
<UnitInput placeholder="Value" />

Properties

PropTypeDefault
icon
ComponentType
-
value
number
-
placeholder
string
-
defaultUnit
string
px
min
number
-
max
number
-
disabled
boolean
false
error
boolean
false

Examples

Icon support

Use the icon property to add an icon to the UnitInput component.

Default unit

Use the defaultUnit property to set the default unit of the input.

Min max

Use the min and max properties to set the minimum and maximum input values.

Error

Use the error property to indicate that the input has an error.

Disabled

Use the disabled property to prevent users from interacting with the input.

On this page