StellarUI

<stellar-passcode>

Properties

Preview

Markup

Copy
<stellar-passcode

  label="Authorization code"
  description="Open your authenticator app to get the code."
  format="### ###"
  value="530901"
  name="code"
>
</stellar-passcode>

API

Complete props, events, slots, and implementation notes for the shipped passcode.

Props

PropTypeDefaultNotes
toneneutral | primary | secondary | tertiary | errorneutral
sizexs | sm | md | lg | xlmd
labelstring''
descriptionstring''
namestring''
valuestring''
formatstring####
disabledbooleanfalse
maskedbooleanfalse
typenumeric | alpha | alphanumeric | anynumeric
case-sensitivebooleanfalse
requiredbooleanfalse
patternstring''
autocompletestringone-time-code
autofocusbooleanfalse
enterkeyhintenter | done | go | next | previous | search | sendenter

Events

EventSourceNotes
inputhostFires when the passcode value changes.
changehostFires when the underlying text input commits a change.
input-completehostFires once the number of entered characters matches the format length.
focushostRedispatched when the hidden text input receives focus.
blurhostRedispatched when the hidden text input loses focus.

Slots

SlotNotes
labelOptional label content. Overrides the label prop when present.
descriptionOptional helper content. Overrides the description prop when present.

Notes

  • The public tag is `stellar-passcode`, matching the shipped fixed-length passcode input surface.
  • `format` controls character cells and delimiters; only `#` positions accept input and delimiter characters are visual-only.
  • `type` filters allowed characters (`numeric`, `alpha`, `alphanumeric`, `any`) before value updates are emitted.
  • `tone` controls the border and active focus-ring color on the character boxes.
  • `masked` hides rendered characters with bullets while preserving the submitted value.
  • `required`, `aria-invalid`, and `custom-validity` forward to the inner native text input for validation-sensitive flows.
  • The host exposes `setCustomValidity()`, `checkValidity()`, `reportValidity()`, `validity`, `validationMessage`, and `willValidate`, so app code can use native-like validity APIs on the custom element.
  • For Datastar, prefer `data-attr:custom-validity="..."` on the custom element host instead of the Pro-only `data-custom-validity` attribute.
  • `input-complete` fires when the entered character count reaches the format's placeholder count.