mcpField
S
syncfusion-aspnetcore-popups

syncfusion-aspnetcore-popups

github.com/syncfusionDesign & UI0101 installsUpdated 3w ago
Repository

About syncfusion-aspnetcore-popups

A reference skill for ASP.NET Core developers implementing Syncfusion popups, covering Dialog, predefined dialogs, and Tooltip configuration, interaction, and accessibility.

Key features

  1. 01Configure Dialog and predefined dialogs
  2. 02Set tooltip triggers and placement
  3. 03Customize animations, templates, and styles
  4. 04Configure keyboard and accessibility behavior

Use cases

  1. 01Build confirmation and alert dialogs
  2. 02Add contextual hints to interface controls

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/syncfusion/aspnetcore-ui-components-skills --skill syncfusion-aspnetcore-popups

After installing, type/syncfusion-aspnetcore-popupsin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
dialog-accessibility-and-localization.md
dialog-animations-and-transitions.md
dialog-api.md
dialog-basic-features.md
dialog-events-and-interactions.md
dialog-getting-started.md
dialog-positioning-and-sizing.md
dialog-styling-and-themes.md
dialog-templates.md
predefineddialog-animation.md
predefineddialog-api.md
predefineddialog-customization.md
predefineddialog-dimension.md
predefineddialog-draggable.md
predefineddialog-getting-started.md
predefineddialog-position.md
tooltip-accessibility.md
tooltip-animation.md
tooltip-api.md
tooltip-content.md
tooltip-customization.md
tooltip-getting-started.md
tooltip-open-mode.md
tooltip-positioning.md

Details

From the project README

Syncfusion ASP.NET Core Popups

Dialog

This skill documents how to implement, configure, and customize the Syncfusion Dialog in ASP.NET Core applications using the <ejs-dialog> Tag Helper API. It covers setup, modality, positioning, animations, templates, events, accessibility, and styling.

Quick Links
Quick Start (Tag Helper)

In your Razor view:

@using Syncfusion.EJ2

<ejs-dialog id="dialog" header="Welcome" isModal="true" width="500px">
    <e-content-template>
        <p>This is a basic dialog with default settings.</p>
    </e-content-template>
</ejs-dialog>

<script>
    window.onload = function () {
        document.getElementById('openBtn').onclick = function () {
            document.getElementById('dialog').ej2_instances[0].show();
        };
    };
</script>

Ensure you include the script manager and styles in your layout (_Layout.cshtml):

<!-- In <head> -->
<link rel="stylesheet" href="https://cdn.syncfusion.com/ej2/{{ site.ej2version }}/fluent.css" />

<!-- At end of <body> -->
<script src="https://cdn.syncfusion.com/ej2/{{ site.ej2version }}/dist/ej2.min.js"></script>
<ejs-scripts></ejs-scripts>
Common Patterns
Modal Confirmation Dialog
<ejs-dialog id="confirmDialog" header="Confirm Action" isModal="true" width="400px">
    <e-dialog-buttons>
        <e-dialog-dialogbutton content="Yes" isPrimary="true" click="confirmAction"></e-dialog-dialogbutton>
        <e-dialog-dialogbutton content="No" click="closeDialog"></e-dialog-dialogbutton>
    </e-dialog-buttons>
    <e-content-template>
        <p>Are you sure you want to proceed?</p>
    </e-content-template>
</ejs-dialog>
Draggable Dialog with Header
<ejs-dialog id="draggableDialog" 
    header="Drag Me" 
    allowDragging="true" 
    width="500px" 
    showCloseIcon="true">
    <e-content-template>
        <p>Grab the header to drag this dialog.</p>
    </e-content-template>
</ejs-dialog>
Centered Dialog
<ejs-dialog id="centeredDialog" 
    header="Centered Position" 
    width="500px">
    <e-dialog-position x="center" y="center"></e-dialog-position>
    <e-content-template>
        <p>This dialog is centered on the page.</p>
    </e-content-template>
</ejs-dialog>
Key Properties
Tag Helper AttributeTypePurposeExample
headerstringDialog title bar textheader="Confirm Delete"
isModalboolShows overlay behind dialogisModal="true"
widthstringDialog width (px, %)width="500px"
heightstringDialog height (px, %)height="300px"
minHeightstringMinimum dialog heightminHeight="150px"
allowDraggingboolEnable drag to repositionallowDragging="true"
enableResizeboolEnable end-user resizingenableResize="true"
showCloseIconboolDisplay close (X) buttonshowCloseIcon="true"
closeOnEscapeboolClose on Escape keycloseOnEscape="true"
visibleboolInitial visibilityvisible="false"
targetstringTarget container selectortarget="#container"
cssClassstringCustom CSS class(es)cssClass="my-dialog"
enableRtlboolRight-to-left renderingenableRtl="true"
enablePersistenceboolPersist state on reloadenablePersistence="true"
zIndexdoubleZ-order stacking levelzIndex="2000"
<e-dialog-position>DialogPositionDataX/Y positioningx="center" y="center"
<e-dialog-animationsettings>DialogAnimationSettingsOpen/close animationeffect="Zoom" duration="400"
footerTemplatestringCustom footer HTML stringfooterTemplate="<span>...</span>"

Removed invalid APIs: is-hidden (use visible="false"), position-x/position-y flat attributes (use <e-dialog-position>), allow-resizing (use enable-resize), max-height, max-width, min-width (not supported).

Next Steps

Read getting-started.md for full installation steps, NuGet package setup, and configuration details.

Predefined Dialog

Predefined dialogs are opened imperatively using the DialogUtility JavaScript utility class. They provide ready-to-use alert, confirm, and prompt dialogs without component setup. Use predefined dialogs for quick notifications and user confirmations.

Key Concept

Predefined dialogs are not Tag Helper components. They are invoked via JavaScript:

ej.popups.DialogUtility.alert({ ... });
ej.popups.DialogUtility.confirm({ ... });

Quick Start
<button class="e-btn e-danger" onclick="showAlert()">Alert</button>

<script>
    function showAlert() {
        ej.popups.DialogUtility.alert({
            title: 'Low Battery',
            width: '250px',
            content: '10% of battery remaining'
        });
    }
</script>

Documentation Guide
Getting Started

📄 Read: references/predefineddialog-getting-started.md

  • Installation and setup
  • Alert, Confirm, and Prompt basic examples
  • JavaScript invocation patterns
Position

📄 Read: references/predefineddialog-position.md

  • position property with X/Y values
  • Center, top, bottom, left, right positioning
  • Custom pixel offsets
Animation

📄 Read: references/predefineddialog-animation.md

  • animationSettings with effect, duration, delay
  • Alert, Confirm, Prompt animation examples
Draggable

📄 Read: references/predefineddialog-draggable.md

  • isDraggable boolean property
  • Dialog drag-to-reposition examples
Dimension

📄 Read: references/predefineddialog-dimension.md

  • width and height properties
  • cssClass for size constraints (min-width, max-width)
Customization

📄 Read: references/predefineddialog-customization.md

  • okButton / cancelButton customization
  • showCloseIcon and closeOnEscape
  • Custom content with HTML strings
API Reference

📄 Read: references/predefineddialog-api.md

  • Full DialogUtility.alert() / confirm() option properties
  • All supported fields and types

Common Patterns

Alert Dialog:

ej.popups.DialogUtility.alert({
    title: 'Info',
    content: 'Operation complete.',
    width: '250px'
});

Confirm Dialog:

var dialogObj = ej.popups.DialogUtility.confirm({
    title: 'Delete?',
    content: 'Are you sure?',
    width: '300px',
    okButton: { text: 'Yes', click: function() { /* delete */ dialogObj.hide(); } },
    cancelButton: { text: 'No', click: function() { dialogObj.hide(); } }
});

Prompt Dialog:

var dialogObj = ej.popups.DialogUtility.confirm({
    title: 'Enter Name',
    content: '<p>Your name:</p><input id="nameInput" class="e-input" placeholder="Type here..." />',
    width: '300px',
    okButton: { text: 'Submit', click: function() { var val = document.getElementById('nameInput').value; dialogObj.hide(); } },
    cancelButton: { click: function() { dialogObj.hide(); } }
});

Tooltip

A tooltip component that displays helpful information or hints when users hover over, click, or focus on an element. The <ejs-tooltip> Tag Helper provides flexible positioning, animations, multiple trigger modes, and accessibility features.

Package: Syncfusion.EJ2.AspNet.Core
Tag Helper: <ejs-tooltip>

Quick Start
<ejs-tooltip id="tooltip" target="#target" position="TopCenter" content="Tooltip Content">
    <e-content-template>
        <button class="e-btn" id="target">Show Tooltip</button>
    </e-content-template>
</ejs-tooltip>

Documentation Guide
Getting Started & Setup

📄 Read: references/tooltip-getting-started.md

  • Installation and CSS imports
  • Basic tooltip on a single element
  • Multi-target tooltips with title attributes
  • Running the application
Content

📄 Read: references/tooltip-content.md

  • String content and HTML markup
  • Template content via <e-content-template>
  • Dynamic content via beforeRender event
  • HTML sanitization for security
Positioning

📄 Read: references/tooltip-positioning.md

  • 12 static positions (TopLeft, TopCenter, TopRight, BottomLeft, etc.)
  • Tip pointer positioning (Start, Middle, End)
  • Dynamic positioning with refresh() method
  • Offset values (offsetX, offsetY)
  • Collision handling (windowCollision)
Open Modes

📄 Read: references/tooltip-open-mode.md

  • Auto, Hover, Click, Focus, Custom modes via opensOn
  • Combining multiple modes (e.g., opensOn="Hover Click")
  • Sticky mode (isSticky) with close button
  • Open/close delays (openDelay, closeDelay)
Animation

📄 Read: references/tooltip-animation.md

  • <e-tooltip-animationsettings> with open/close effects
  • 7+ animation effects (FadeIn, ZoomIn, SlideUp, etc.)
  • Duration and delay configuration
  • Disable animations with effect: 'None'
Customization

📄 Read: references/tooltip-customization.md

  • cssClass for custom styling
  • Tip pointer visibility and customization
  • Dimensions (width, height)
  • RTL support (enableRtl)
  • Mouse trailing (mouseTrail)
Accessibility

📄 Read: references/tooltip-accessibility.md

  • WCAG 2.2 and Section 508 compliance
  • ARIA attributes (role, aria-describedby, aria-hidden)
  • Keyboard navigation (Tab, Escape)
  • Screen reader support and focus management
  • Best practices for accessible tooltips
API Reference

📄 Read: references/tooltip-api.md

  • All properties with types and defaults
  • Methods: open(), close(), refresh(), destroy(), dataBind()
  • Events: BeforeRender, AfterOpen, AfterClose, Created, Destroyed
  • Position and TipPointerPosition enum values

Common Patterns

Basic Tooltip on Button:

<ejs-tooltip id="tooltip" target="#target" position="TopCenter" content="Submit the form">
    <e-content-template>
        <button class="e-btn" id="target">Submit</button>
    </e-content-template>
</ejs-tooltip>

Multi-Target Tooltip:

<ejs-tooltip id="tooltip" target=".info-icon" position="TopCenter">
    <e-content-template>
        <button class="e-btn info-icon" title="Information">Info 1</button>
        <button class="e-btn info-icon" title="Details">Info 2</button>
        <button class="e-btn info-icon" title="Help">Info 3</button>
    </e-content-template>
</ejs-tooltip>

Click-Triggered Sticky Tooltip:

<ejs-tooltip target="#target" content="Click the × to close me" 
    opensOn="Click" 
    isSticky="true" 
    position="BottomCenter">
    <e-content-template>
        <button id="target" class="e-btn">Click Me</button>
    </e-content-template>
</ejs-tooltip>

Programmatic Open/Close:

<ejs-tooltip id="tooltip" target="#target" content="Tooltip opened programmatically" opensOn="Custom">
    <e-content-template>
        <button id="target" class="e-btn" onclick="toggleTooltip()">Toggle Tooltip</button>
    </e-content-template>
</ejs-tooltip>

<script>
    function toggleTooltip() {
        var tooltipObj = document.getElementById('tooltip').ej2_instances[0];
        var btn = document.querySelector('.e-btn');
        
        if (btn.getAttribute('data-tooltip-open') === 'true') {
            tooltipObj.close();
            btn.setAttribute('data-tooltip-open', 'false');
        } else {
            tooltipObj.open(btn);
            btn.setAttribute('data-tooltip-open', 'true');
        }
    }
</script>

Key Properties at a Glance
Tag Helper AttrTypeDefaultPurpose
contentstring—Tooltip text or HTML
targetstring—CSS selector for multi-target mode
positionPosition'TopCenter'12 placement values
opensOnstring'Auto'Hover / Click / Focus / Custom
isStickyboolfalseKeep visible until user closes
mouseTrailboolfalseFollow mouse cursor
showTipPointerbooltrueShow/hide arrow tip
tipPointerPositionTipPointerPosition'Auto'Auto / Start / Middle / End
openDelaynumber0ms delay before opening
closeDelaynumber0ms delay before closing
offsetX / offsetYnumber0Distance from target (px)
width / heightstring | number'auto'Tooltip dimensions
cssClassstringnullCustom CSS class
enableRtlboolfalseRight-to-left rendering
enableHtmlSanitizerbooltrueSanitize HTML content
windowCollisionboolfalseCollision vs viewport

Comments

Markdown supported