How can I help you?
Separator in Angular OTP Input component
26 Feb 20262 minutes to read
The separator specifies the character or symbol displayed between each OTP input field to visually distinguish and organize the inputs. Common separators include hyphens (-), spaces, or dashes. Configure the separator character using the separator property.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { FormsModule } from '@angular/forms'
import { OtpInputModule } from '@syncfusion/ej2-angular-inputs'
import { enableRipple } from '@syncfusion/ej2-base'
import { Component } from '@angular/core';
@Component({
imports: [
FormsModule, OtpInputModule
],
standalone: true,
selector: 'app-root',
template: `<!-- To Render OTP Input component. -->
<div class="wrap">
<div id='otp-container' style="width: 350px;">
<div ejs-otpinput separator="/"></div>
</div>
</div>`
})
export class AppComponent { }import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));/* Represents the styles for loader */
#loader {
color: #008cff;
height: 40px;
left: 45%;
position: absolute;
top: 45%;
width: 30%;
}
.wrap {
margin: 50px auto;
}