sterling-svelte  1.0.12
A modern, accessible, lightweight UI component library for Svelte.
Exciting News! sterling-svelte 2.0 is out and built on Svelte 5! Read all about it here!

Input

An <input>: an interactive element to accept data from the user

Code
<script lang="ts">
  import { Input } from '@geoffcox/sterling-svelte';
</script>

<Input value="sterling-svelte" />

Members

Property Name Type Default Comment
variant string '' Additional class names to apply

Considerations

  • Prefer using the Label component rather than the label produced by providing default slot content.
  • Includes HTMLInputElement props, event, and methods

Anatomy

<label class="sterling-input-label">
  <slot {disabled} {value} {variant} />
</label>
<div class="sterling-input">
  <input />
</div>