Spelte

Open Github

Label Input

Input field with floating label and password visibility toggle.

Installation

pnpm dlx shadcn-svelte@latest add https://spelte.dev/r/label-input.json

Examples

Password Input

Ring Color

Props

PropTypeDefaultDescription
type"text" | "email" | "password" | "search" | "tel" | "url" | "number" | "hidden""text"Controls the input type and enables the password visibility toggle when set to password.
labelstring""The floating label text rendered inside the field container.
ringColorRingColor | undefined"muted"Selects the focus ring color variant for the input.
valuestring | number | undefinedundefinedControlled field value. Supports bind:value.
placeholderstring | undefined""Hidden by default and revealed during focus to avoid competing with the label.
containerClassNamestring | undefinedundefinedCustom classes applied to the outer wrapper element.
inputClassNamestring | undefinedundefinedCustom classes applied directly to the input element.
disabledboolean | undefinedfalseDisables typing, focus styles, and the password toggle button.
classstring | undefinedundefinedCustom classes merged onto the wrapper root.