Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Forms Form-associated

Input <pm-input>

Single-line text field for text, email, numbers, passwords, search and more.

Full screen
https:// .com

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/input'; import { registerIcons } from '@prismora/elements/icon'; import { mail } from '@prismora/icons'; registerIcons([mail]); </script> <pm-input label="Email" type="email" name="email" placeholder="[email protected]" hint="We never share it." icon-start="mail" required></pm-input> <pm-input label="Password" type="password" password-toggle strength></pm-input> <pm-input label="Phone" type="tel" mask="(999) 999-9999" placeholder="(555) 010-2030" inputmode="numeric"></pm-input> <pm-input label="Website" placeholder="example" clearable> <span slot="start">https://</span> <span slot="end">.com</span> </pm-input> <pm-input label="Bio" maxlength="80" show-count></pm-input>

Sizes

Set with the size attribute; controls keep touch-sized targets on phones.

size="xs"
size="sm"
size="md"
size="lg"
size="xl"

States

Each state is one attribute.

Disabled
Read-only
Required
Error

Attributes

AttributeTypeDefaultDescription
maskstring—Input mask: 9 a digit, a a letter, * either; other characters are typed for the user. E.g. mask="(999) 999-9999", mask="99/99", mask="aa-9999".
strengthbooleanfalseShow a strength bar under a password field (length and character variety; a guide, not a security check).
icon-start
prop: iconStart
string—Registered icon name shown before the content (see registerIcons); a start slot overrides it.
icon-end
prop: iconEnd
string—Registered icon name shown after the content (see registerIcons); an end slot overrides it.
typestringtextNative type of the underlying control.
placeholderstring—Hint text shown while empty (not a replacement for label).
autocompletestring—Browser autofill hint (the HTML autocomplete token).
inputmodestring—Virtual keyboard to show on touch devices (the HTML inputmode).
patternstring—Regular expression the value must match.
minlengthnumber—Minimum number of characters.
maxlengthnumber—Maximum number of characters.
minstring—Lowest allowed value.
maxstring—Highest allowed value.
stepstring—Increment between allowed values.
clearablebooleanfalseShows a clear (✕) button when there is a value.
password-toggle
prop: passwordToggle
booleanfalseFor type="password": a button to show/hide the password.
show-count
prop: showCount
booleanfalseShows "n / maxlength" (or "n" without maxlength) under the input.
namestring—Form field name: the value is submitted under it.
valuestring—Current value (submitted with the form).
labelstring—Visible label (required for accessibility; use hide-label to visually hide it).
hintstring—Help text under the field, linked to it for screen readers.
errorstring—Custom error message. Setting it marks the control invalid.
size'xs' | 'sm' | 'md' | 'lg' | 'xl'—Control size.
requiredbooleanfalseThe form cannot be submitted until this has a value.
disabledbooleanfalseNot interactive and not submitted.
readonlybooleanfalseFocusable and submitted, but not editable.
hide-label
prop: hideLabel
booleanfalseHide the label visually; it stays the accessible name.

Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.

Events

EventReact / Svelte propDescription
pm-clearonPmClearThe clear button was pressed.
pm-inputonPmInputOn every value change while editing.
pm-changeonPmChangeWhen the value is committed.

Slots

SlotDescription
endTrailing adornment.
startLeading adornment (icon or text such as "https://").

CSS parts

PartDescription
::part(control)The native input.
::part(counter)Character counter (with show-count).

Methods

checkValidity(), reportValidity(), validate(), focus()

Used in templates

Overview dashboardTraffic analyticsOrdersCustomer 360InboxTeam chatAI assistantNotificationsProject boardTeam and rolesBilling and invoicesUser profileAccount settingsSign inCreate accountForgot passwordChoose a new passwordProduct pageShopping cartCheckoutLanding pageArticleChangelogHelp centreContactComing soonNot found (404)Onboarding wizardAppointment bookingFeedback survey