Skip to content
h v3.13.3
Search the docs
Find a component, section or page.

Input

A text input component for forms and user data entry with built-in styling and accessibility features.

Installation

pnpm add @heyramzi/ui

Usage

import { Input } from "@heyramzi/ui/shadcn/input";

Examples

With a label and hint

Wrap the input in a Field so the label, the hint and the input line up and read as one.

It shows on your public profile.

Disabled

A disabled input dims, takes no clicks and drops out of the tab order.

Invalid

Set aria-invalid on the input and the border and ring turn red, with the error read out below.

File

Set type to file and bind files to get the FileList back.

PNG or JPG, up to 2 MB.

API reference

Input.Root

type InputType
files bindable undefined
ref bindable HTMLElement | null
Default null
value bindable HTMLInputAttributes
class string
data-slot string
Default "input"
...rest
Every prop of HTMLInputAttributes from svelte/elements except type
Prop Type Default
type InputType
files bindable undefined
ref bindable HTMLElement | null null
value bindable HTMLInputAttributes
class string
data-slot string "input"
...rest Every prop of HTMLInputAttributes from svelte/elements except type

Input.SecretInput

variant "lock" | "obfuscate"
Default "lock"
value bindable string
Default ""
class string
revealLabel string
Default "Reveal value"
The reveal button's name while the value is hidden, in the app's language.
hideLabel string
Default "Hide value"
The same button's name while the value shows.
maskedLabel string
Default "Encrypted value"
The name of the `obfuscate` box.
...rest
Every prop of HTMLInputAttributes from svelte/elements except class, files, type, value
Prop Type Default
variant "lock" | "obfuscate" "lock"
value bindable string ""
class string
revealLabel

The reveal button's name while the value is hidden, in the app's language.

string "Reveal value"
hideLabel

The same button's name while the value shows.

string "Hide value"
maskedLabel

The name of the `obfuscate` box.

string "Encrypted value"
...rest Every prop of HTMLInputAttributes from svelte/elements except class, files, type, value