TidalUI

Masked input preview

Enter structured identifiers through a native text field while forms receive the exact raw token value.

pro · Forms · primitive

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/masked-input

Import components/ui/tidal.css, components/ui/masked-input.css. Wrap installed components in tidal-scope.

Preview

Masked input component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/masked-input.css";
import{TidalMaskedInput}from"./components/ui/masked-input";
export default()=><div className="tidal-scope"><TidalMaskedInput label={"Demo"} mask={"value"} onValueChange={() => {}} value={"value"}/></div>;

API and props

TidalMaskedInput.label (required)
ReactNode

Required label value accepted by this exported component.

TidalMaskedInput.mask (required)
string

A bounded mask. Defaults: # digit, A ASCII letter, * ASCII letter or digit.

TidalMaskedInput.onValueChange (required)
(value: string, event: ChangeEvent<HTMLInputElement> | KeyboardEvent<HTMLInputElement> | CompositionEvent<HTMLInputElement>) => void

Callback invoked when the value change interaction is proposed.

TidalMaskedInput.value (required)
string

Controlled raw token characters, without mask literals.

TidalMaskedInput.aria-disabled
Booleanish | undefined

Accessible disabled supplied by the consumer.

TidalMaskedInput.aria-invalid
boolean | "true" | "false" | "grammar" | "spelling" | undefined

Accessible invalid supplied by the consumer.

TidalMaskedInput.description
ReactNode

Optional description value accepted by this exported component.

TidalMaskedInput.disabled
boolean | undefined

Optional disabled value accepted by this exported component.

TidalMaskedInput.error
ReactNode

Optional error value accepted by this exported component.

TidalMaskedInput.hiddenInputRef
Ref<HTMLInputElement> | undefined

Optional hidden input ref value accepted by this exported component.

TidalMaskedInput.labels
TidalMaskedInputLabels | undefined

Optional labels value accepted by this exported component.

TidalMaskedInput.name
string | undefined

Optional name value accepted by this exported component.

TidalMaskedInput.onChange
ChangeEventHandler<HTMLInputElement, HTMLInputElement> | undefined

Callback invoked when the change interaction is proposed.

TidalMaskedInput.onCompositionEnd
CompositionEventHandler<HTMLInputElement> | undefined

Callback invoked when the composition end interaction is proposed.

TidalMaskedInput.onCompositionStart
CompositionEventHandler<HTMLInputElement> | undefined

Callback invoked when the composition start interaction is proposed.

TidalMaskedInput.onInput
InputEventHandler<HTMLInputElement> | undefined

Callback invoked when the input interaction is proposed.

TidalMaskedInput.onKeyDown
KeyboardEventHandler<HTMLInputElement> | undefined

Callback invoked when the key down interaction is proposed.

TidalMaskedInput.readOnly
boolean | undefined

Optional read only value accepted by this exported component.

TidalMaskedInput.required
boolean | undefined

Optional required value accepted by this exported component.

TidalMaskedInput.rootClassName
string | undefined

Optional root class name value accepted by this exported component.

TidalMaskedInput.tokens
ReadonlyArray<TidalMaskToken> | undefined

Optional tokens value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas