dssoca docs

Input

Labelled text input with validation affordances.

A text input with an optional label, auto-wired id, and `invalid` / `describedby` for accessible error messaging.

Demo

live · storybook Open in Storybook

Demo loads from http://localhost:6006. Run pnpm storybook for it to render locally.

Usage

svelte
<script>
  import { Input } from 'dssoca';
  let email = $state('');
</script>

<Input label="email" type="email" bind:value={email}
  placeholder="rafael@hub.home" />

Props

PropTypeDefaultDescription
labelstringVisible label (associated via generated id).
valuestringBindable value.
typestring'text'Native input type.
placeholderstringPlaceholder text.
requiredbooleanfalseMarks the field required.
disabledbooleanfalseDisable the field.
invalidbooleanfalseApply invalid styling + aria-invalid.
describedbystringid of an error/hint element (aria-describedby).
oninput(e) => voidInput handler.
size'sm' | 'md' | 'lg'Per-instance size override; inherits the ancestor `data-size-variant` when unset.