packages/components/eui-snc/eui-snc.component.ts
Show and Conceal (SNC) component that toggles visibility of sensitive content with masked placeholder. Displays a configurable number of dots to represent hidden content length. Provides a toggle button to reveal or conceal the actual content. Commonly used for passwords, API keys, tokens, or other sensitive information that should be hidden by default. Emits visibility state changes for parent components to track or respond to content exposure.
<!-- Simple password field -->
<eui-snc [dotsLength]="12" (sncToggle)="onToggle($event)">
MySecretPassword123
</eui-snc>onToggle(isVisible: boolean) {
console.log('Content is now:', isVisible ? 'visible' : 'hidden');
}| selector | eui-snc |
| imports |
EUI_BUTTON
|
| styleUrls | ./eui-snc.component.scss |
| templateUrl | ./eui-snc.component.html |
Properties |
Methods |
Inputs |
Outputs |
HostBindings |
| sncToggle |
Type : boolean
|
|
Emitted when the content visibility state changes via toggle button interaction. Payload: boolean indicating the new visibility state (true when content is shown, false when concealed). |
| class |
Type : string
|
Default value : 'eui-snc'
|
| toggleContent |
toggleContent()
|
|
Returns :
void
|
| string |
Type : string
|
Default value : 'eui-snc'
|
Decorators :
@HostBinding('class')
|