Coral.Shell.User

Current Version: 1.2.2

The Shell.User component is intended to for use as a Shell.Menubar item that offers access to app user details and related functionality. It is part of the default Shell 3 pattern. It has sub-components to create content zones for user details, links to administration, account management, and sign out functionality.

Below is an example of menu content:

Shantanu Narayen CEO Adobe Systems, Inc.

Extra goodies go here

Sign Out Profile
Show Markup

        

See the complete Shell3 documentation for more detail on the default use of the components in this pattern.

Coral.Shell.User API

Constructor

JavaScript:

new Coral.Shell.User() or document.createElement('coral-shell-user')

HTML Tag:

<coral-shell-user>

Extends

Sub-components

Instance Properties

instance.avatar {String}

Specifies the asset used inside the avatar view. See Coral.Icon for valid usage and icon names.
Default Value:
  • user (Shows a placeholder user icon from the icon font)
HTML Attribute:
  • avatar
See:

instance.avatar {String}

Avatar assets should use one of those provided, when no asset is set

Properties:

Name Type Value Description
DEFAULT String user Default avatar, show user icon from icon font.

instance.content {HTMLElement}

The main content zone of the user-menu.

instance.footer {HTMLElement}

The footer content zone of the user-menu.

instance.heading {HTMLElement}

The heading content zone of the user-menu.

instance.hidden {Boolean}

Reflected
Whether this component is hidden or not.
Inherited From:
Default Value:
  • false
HTML Attribute:
  • hidden

instance.name {HTMLElement}

The name content zone of the user-menu.

instance.subheading {HTMLElement}

The subheading content zone of the user-menu.

Methods

instance.get

Get the value of a property.
Parameters:
Name Type Description
property String The name of the property to fetch the value of.
Returns:
Property value. {*}
Inherited From:

instance.hide

Hide this component.
Returns:
this, chainable {Coral.Component}
Inherited From:

instance.off

Remove an event listener.
Parameters:
Name Type Optional Description
eventName String No
The event name to stop listening for.
selector String Yes
The selector that was used for event delegation.
func function No
The function that was passed to on().
useCapture Boolean Yes
Only remove listeners with useCapture set to the value passed in.
Returns:
this, chainable. {Coral.Component}
Inherited From:

instance.on

Add an event listener.
Parameters:
Name Type Optional Default Description
eventName String No
The event name to listen for.
selector String Yes
The selector to use for event delegation.
func function No
The function that will be called when the event is triggered.
useCapture Boolean Yes
Whether or not to listen during the capturing or bubbling phase.
Returns:
this, chainable. {Coral.Component}
Inherited From:

instance.remove

Non-destructively remove this element. It can be re-added by simply appending it to the document again. It will be garbage collected if there are no more references to it.
Inherited From:

instance.set

Set a single property.
Parameters:
Name Type Description
property String The name of the property to set.
value * The value to set the property to.
silent Boolean If true, events should not be triggered as a result of this set.
Returns:
this, chainable. {Coral.Component}
Inherited From:

instance.show

Show this component.
Returns:
this, chainable {Coral.Component}
Inherited From:

instance.trigger

Trigger an event.
Parameters:
Name Type Optional Default Description
eventName String No
The event name to trigger.
props Object Yes
Additional properties to make available to handlers as event.detail.
bubbles Boolean Yes
Set to false to prevent the event from bubbling.
cancelable Boolean Yes
Set to false to prevent the event from being cancelable.
Returns:
CustomEvent object {CustomEvent}
Inherited From:

Events

coral-component:attached

Triggered when the component is attached to the DOM.
Callback Parameters:
Name Type Description
event Object Event object.
Inherited From:
Deprecated:
  • since 1.14.0, use MutationObserver instead.

    coral-component:detached

    Triggered when the component is detached to the DOM.
    Callback Parameters:
    Name Type Description
    event Object Event object.
    Inherited From:
    Deprecated:
    • since 1.14.0, use MutationObserver instead.

      coral-component:ready

      Triggerred when the component has been upgraded and is ready for use.
      Callback Parameters:
      Name Type Description
      event Object Event object.
      Inherited From:
      Deprecated:
      • since 1.9.0, use Coral.commons.ready() instead.