PopoutReady

Popouts are small overlays that open on demand. They let users access additional content and actions without cluttering the page.

Edit in CodePen
Open in new window
Edit in CodePen
Open in new window
Edit in CodePen
Open in new window
Edit in CodePen
Open in new window
Edit in CodePen
Open in new window
Edit in CodePen
Open in new window
Edit in CodePen
Open in new window
Edit in CodePen
Open in new window
Edit in CodePen
Open in new window
View RTL
<nord-stack style="margin-bottom: var(--n-space-xl)" direction="horizontal" justify-content="center">
  <nord-button variant="primary" aria-controls="example" aria-haspopup="true">Toggle popout</nord-button>
</nord-stack>

<nord-popout id="example" position="block-end">
  <div style="padding: var(--n-space-m)">Popout content</div>
</nord-popout>

Properties

PropertyAttributeDescriptionTypeDefault
idid

The id for the active element to reference via aria-controls.

string""
anchoranchor

Set an optional anchor element to align against, replacing the triggering element.

string | undefinedundefined
openopen

Controls whether the component is open or not.

booleanfalse
alignalign

Set the alignment in relation to the toggle (or anchor) depending on the position. start will align it to the left of the toggle (or anchor). end will align it to the right of the toggle (or anchor). Setting the position to inline-start or inline-end will switch start and end to the top and bottom respectively.

"start" | "end""start"
positionposition

Set the position in relation to the toggle (or anchor). Options follow logical properties. block-start and block-end referring to top and bottom respectively, inline-start and inline-end referring to left and right respectively.

"block-end" | "block-start" | "inline-start" | "inline-end""block-end"

Events

EventDescriptionType
open

Dispatched when the popout is opened.

NordEvent
close

Dispatched when the popout is closed.

NordEvent

Slots

Slot nameDescription
Default slot

The popout content.

Methods

Method nameParametersDescription
show() => Promise<TransitionEvent | void>N/A

Show the popout. A promise that resolves to a TransitionEvent when the popout's show animation ends or is cancelled. If the popout is already open, the promise resolves immediately with undefined.

hide(moveFocusToButton: boolean) => Promise<TransitionEvent | void>moveFocusToButton: prevent focus returning to the target button. Default is true.

Hide the popout. Returns a promise that resolves to a TransitionEvent when the popout's hide animation ends or is cancelled. If the popout is already closed, the promise resolves immediately with undefined.

Usage

This section includes guidelines for designers and developers about the usage of this component in different contexts.

Do

  • Always position popout next to the button or other interface element that toggles it.
  • Use a popout to contain controls or information that doesn’t need to be shown immediately.
  • Use a popout to contain items that will most likely not fit into the current view.
  • Use a clearly labelled button to reveal the popout.
  • Use the appropriate aria-haspopup and role attributes for both the toggle button and containing items. Please refer to the MDN documentation on both role values and child role values.

Don’t

  • Don’t hide information inside a popout that is imperative to using the current view.
  • Don’t obscure other controls that are important with the popout.
  • Don’t allow the popout to be obscured by other controls or the outer bounds of the current view.

Content guidelines

If a popout contains actions, they should be always written in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):

Create user
Create User

Popout actions should always lead with a strong verb that encourages action. Use the {verb}+{noun} format except in the case of common actions like Save, Close or Cancel:

Edit row
Editing options

Avoid unnecessary words and articles in popout actions, such as “the”, “an” or “a”:

Change theme
Change the theme

Avoid ending popout actions in punctuation:

Switch user
Switch user.

Avoid all caps for popout actions:

Rename
RENAME

Additional considerations

  • The popout component is a containing component, only providing a way to reveal and hide controls by using a single button.

Integration

For integration guidelines, please see Web Components documentation. This documentation explains how to implement and use Nord Web Components across different technologies such as Vue.js, React, or Vanilla JavaScript.

Integration Guidelines

Troubleshooting

If you experience any issues while using Nord Web Components, please head over to the Support page for more guidelines and ways to contact us.


Was this page helpful?

YesNo
Send feedback

We use this feedback to improve our documentation.