TutorialModal
Description
The TutorialModal is a surface component used to display a guided tutorial or multi-step process to the user. It provides a structured modal layout with an explanatory section on the left and a content area on the right where complex input forms or guided instructions can be embedded. Use this component when you need to create a rich, interactive modal that not only displays information but also collects user input through embedded controls.
Usage
Import the necessary namespaces and instantiate the TutorialModal using the helper method from Tesserae.UI. The component follows a fluent interface style, allowing you to chain settings for title, help text, images, content, footer commands, and dimensions.
API reference
public class TutorialModal : IComponent, ISpecialCaseStylingA specialized Modal component designed for showing tutorials or onboarding information, featuring a split layout with an explanation area and a content area.
Constructors
Properties
public HTMLElement StylingContainerGets the styling container for the tutorial modal.
Methods
public TutorialModal SetContent(IComponent content)Sets the main content of the tutorial modal.
Parameters
- content
- The content component.
Returns
The current instance of the type.
public TutorialModal Height(UnitSize height)Sets the height of the tutorial modal.
Parameters
- height
- The height.
Returns
The current instance of the type.
public TutorialModal H(UnitSize height)Sets the height of the tutorial modal.
Parameters
- height
- The height.
Returns
The current instance of the type.
public TutorialModal Width(UnitSize width)Sets the width of the tutorial modal.
Parameters
- width
- The width.
Returns
The current instance of the type.
public TutorialModal W(UnitSize width)Sets the width of the tutorial modal.
Parameters
- width
- The width.
Returns
The current instance of the type.
public TutorialModal SetTitle(string title)Sets the title of the tutorial modal.
Parameters
- title
- The title.
Returns
The current instance of the type.
public TutorialModal SetHelpText(string helpText, bool treatAsHTML = false)Sets the help text of the tutorial modal.
Parameters
- helpText
- The help text.
- treatAsHTML
- Whether to treat the help text as HTML.
Returns
The current instance of the type.
public TutorialModal SetImageSrc(string imageSrc, UnitSize padding)Sets the illustration image source URL and padding.
Parameters
- imageSrc
- The image source URL.
- padding
- The padding around the image.
Returns
The current instance of the type.
public TutorialModal SetImage(Image image, UnitSize padding)Sets the illustration image and padding.
Parameters
- image
- The image component.
- padding
- The padding around the image.
Returns
The current instance of the type.
public TutorialModal LightDismiss()Enables light dismiss (closing the modal when clicking outside of it).
Returns
The current instance of the type.
public TutorialModal NoLightDismiss()Disables light dismiss.
Returns
The current instance of the type.
public TutorialModal ContentPadding(string padding)Sets the padding for the content area.
Parameters
- padding
- The padding.
Returns
The current instance of the type.
public IComponent ShowEmbedded()Returns the tutorial modal as an embedded component rather than showing it as a modal layer.
Returns
An IComponent representing the embedded modal.
public TutorialModal Border(string color, UnitSize size = null)Sets the border color and size for the tutorial modal.
Parameters
- color
- The border color.
- size
- The border size.
Returns
The current instance of the type.
public TutorialModal Show()Shows the tutorial modal.
Returns
The current instance of the type.
public TutorialModal OnHide(Modal.OnHideHandler onHide)Adds a hide event handler to the tutorial modal.
Parameters
- onHide
- The hide event handler.
Returns
The current instance of the type.
public TutorialModal OnShow(Modal.OnShowHandler onShow)Adds a show event handler to the tutorial modal.
Parameters
- onShow
- The show event handler.
Returns
The current instance of the type.
public void Hide(Action onHidden = null)Hides the tutorial modal.
Parameters
- onHidden
- An optional action to perform when the modal is hidden.
Samples
Basic Tutorial Modal
This sample demonstrates how to create and display a basic TutorialModal with a custom title, help text, image, content inputs, and footer commands.
Embedded Tutorial Modal
This sample shows how to embed a TutorialModal within an existing container.