Input
A text input component for forms and user data entry with built-in styling and accessibility features.
Installation
pnpm add @heyramzi/uiUsage
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.
Invalid
Set aria-invalid on the input and the border and ring turn red, with the error read out below.
Add the part after the @.
API reference
Input.Root
typeInputTypefilesbindableundefinedrefbindableHTMLElement | null- Default
null valuebindableHTMLInputAttributesclassstringdata-slotstring- Default
"input" ...rest- Every prop of
HTMLInputAttributesfromsvelte/elementsexcepttype
| 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" valuebindablestring- Default
"" classstringrevealLabelstring- Default
"Reveal value" - The reveal button's name while the value is hidden, in the app's language.
hideLabelstring- Default
"Hide value" - The same button's name while the value shows.
maskedLabelstring- Default
"Encrypted value" - The name of the `obfuscate` box.
...rest- Every prop of
HTMLInputAttributesfromsvelte/elementsexceptclass, 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 | |