Skip to content
Velkin LogoVelkin Logo
Velkin
VELKIN/UI

Modern UI components for product teams and their AI agents. Lit core, typed wrappers, live MCP.

sales@velkinui.com

Product

  • Docs
  • Components
  • Studio
  • Pricing

Resources

  • Quick start
  • Blog
  • Changelog
  • Roadmap
  • Status

Project

  • About
  • Contact
  • License
  • Privacy
  • Terms

© 2026 Velkin. MIT core · Pro licenses available.

VELKIN

Serial

A serial input component for license keys with group separators.

vu-serial · @velkin/react/serial

Copy page

Import

React
npm i @velkin/react

import { VuSerial } from "@velkin/react/serial";

Examples

API

Props

PropTypeDefaultDescription
namestring—Form field name for submit (`name` attr).
defaultvaluestring—Restored on `<form reset>` (`defaultvalue` attr).
formidstring—External `<form>` id (`formid` attr).
disabledboolean—Non-interactive; blocks cell entry (`disabled` attr).
readonlyboolean—Focusable but cannot change cells (`readonly` attr).
requiredboolean—Blocks valid submit when incomplete (`required` attr).
requiredmessagestring—Custom `valueMissing` message (`requiredmessage` attr).
labelstring""Plain-text label; slotted `label` wins when assigned.
hintstring""Helper text; `hint` slot wins when assigned.
idstring""Host id for label `for` / `aria-*` wiring.
variantVuSerialVariant"default"Field chrome recipe. Default: `"default"`.
toneVuSerialTone"normal"Neutral surface weight. Default: `"normal"`.
sizeVuSerialSize"md"Cell scale. Default: `"md"`.
radiusVuSerialRadius"md"Corner preset (`none`/`sm`/`md`/`lg`/`full`). Default: `md`.
blockbooleanfalseStretches the cell row to the container width. Default: `false`.
compactbooleanfalseTighter label/hint/error spacing. Default: `false`.
lengthnumber10Total number of character boxes. Default: `10`.
separatorstring"-"Separator character between groups. Default: `"-"`.
separatorpositionsnumber[]—Cell indices after which a separator is shown (JS-only).
alphanumericbooleanfalseAllows letters in addition to digits. Default: `false`.
valuestring""Canonical serial string (may include separators). Default: `""`.
withseparatorboolean—Includes separators in `value` and form submission. Default: `false`.
maskedbooleanfalseMasks cell glyphs (`type="password"`). Default: `false`.
showerrorsboolean—Shows validation after activation (`showerrors` attr). Default: `false`.
validationactiveboolean—Drives invalid styling after activation (`validationactive` attr). Default: `false`.
invalidbooleanfalseTrue when last validation found errors (`invalid` attr). Default: `false`.
incompletemessagestring—Error when some cells are filled but not all; empty uses default.
arialabelstring—Names the row when no visible label is present.
separatorPositionsnumber[][3]Cell indices after which a separator is inserted (e.g. `[3, 6]`).
withSeparatorbooleanfalseIncludes separators in `value` and form submission.
incompleteMessagestring""Error when some cells are filled but not all; empty uses a default.
ariaLabelstring""Names the row when no visible label is present.
showErrorsbooleanfalseShows validation after activation.
validationActivebooleanfalseDrives invalid styling after activation.

Events

EventDetailDescription
vu-changeVuSerialChangeDetailCommitted value change (`detail.value`).
vu-invalidVuSerialInvalidDetailWhen validation messages are recomputed.
vu-clearVuSerialClearDetailAfter `reset()` syncs from `defaultValue`.

Slots

SlotDescription
labelRich label markup; takes precedence over string `label` when assigned.
hintOptional helper copy (HTML); overrides string `hint` when assigned.
errorReplaces default validation message list when assigned.

CSS parts

PartDescription
fieldColumn stacking label, cells row, hint, and error.
labelLabel element above the serial row.
cellsFlex row wrapping groups and separators (`role="group"`).
groupTight cluster of cells between separators.
separatorVisual separator glyph between groups.
cellOne serial character input.
hintNeutral helper text under the row.
error-messageRegion for `slot="error"` or stacked default validation lines.
error-lineOne default validation string when `slot="error"` is empty.
textString `label` text when the `label` slot is empty.

Methods

MethodDescription
reset- Clears cells to `defaultValue` and dispatches `vu-clear`.
focusFirst- Focuses the first serial cell.
validateInput- Runs validators and syncs validity.

Types

NameDefinition
VuSerialChangeDetail
{ value: string; }
VuSerialClearDetail
{ value: string; }
VuSerialInvalidDetail
{ errors: string[]; }
VuSerialRadius
"sm" | "md" | "lg" | "none" | "full"
VuSerialSize
"sm" | "md" | "lg"
VuSerialTone
"subtle" | "normal" | "strong"
VuSerialVariant
"outline" | "default" | "underline"

Related

Inputs

  • Advanced FilterAn advanced filter component with expression input and visual builder.
  • ButtonA clickable button component with multiple variants and states.
  • Button GroupA button group component with shared styling and optional selection.
  • CheckboxA checkbox component with label, hint, and validation.
  • Checkbox GroupA checkbox group component with shared label and validation.
  • Color AreaA two-dimensional color picker component for saturation and brightness.

Guides

  • FormsFormData, VuForm, and validation
  • EventsonVu* / v-model / e.detail
  • Appearancevariant, color, tone, size

Browse

  • Previous: RangeEarlier in the sidebar
  • Next: SliderLater in the sidebar
  • All componentsBrowse the full index