A flyout component in react.

Parameters:
NameTypeDescription
propsobject

Component props.

Properties
NameTypeDescription
afterContentJSX.Element

Any custom content to be placed after the body of the flyout.

animationDelaynumber

Total runtime of close animation. Synchronize with css if modifying the built-in 250 ms delay.

beforeContentJSX.Element

Any custom content to be placed before the header of the flyout.

childrenJSX.Element

React element children in the flyout body.

closeButtonCustomAttributesobject

Custom attributes for the close button.

closeOnMaskClickboolean

Whether to close if the background mask is clicked.

customAttributesobject

Custom attributes for the component.

customBodyClassesstring | Array | object

Custom classes for the flyout body as array.

customClassesstring | Array | object

Custom classes for the component.

customInnerBodyClassesstring | Array | object

Custom classes for the flyout inner_body as array.

customMaskClassesstring | Array | object

Custom classes for the mask as array.

descriptionstring

Subheading description for the flyout.

desktopWidthstring

Width for the flyout on desktop.

directionstring

Flyout direction, left or right.

expandableboolean

Whether to enable the ability to allow expanding to a larger width.

expandableButtonCustomAttributesobject

Custom attributes for the expandable button.

expandableWidthDesktopstring

Width to expand to if expanded on desktop.

expandableWidthMobilestring

Width to expand to if expanded on mobile.

footerChildrenLeftJSX.Element

React element children in the flyout footer on the left.

footerChildrenRightJSX.Element

React element children in the flyout footer on the right.

footerIsFixedboolean

Whether or not the footer is fixed.

headerChildrenLeftJSX.Element

React element children in the flyout header on the left.

headerChildrenRightJSX.Element

React element children in the flyout header on the right.

headerDescriptionCustomAttributesobject

Custom attributes for the header description.

headerHeadingCustomAttributesobject

Custom attributes for the header heading.

headerIsFixedboolean

Whether or not the header is fixed.

idstring

Flyout id.

isExpandedboolean

Prop to control whether the flyout is currently expanded.

isOpenboolean

Prop to control whether the dialog is currently open.

maskBlurboolean

Whether to blur behind the mask for the flyout.

maskClickExcludeButtonsArray

Array of button codes that will not close the flyout on mask click, 0 = left click, 1 = middle click, 2 = right click, 3 = back button, 4 = forward button, 5 = X1, 6 = X2.

maskThemestring

Mask background color scheme: none, light or dark

maxWidthnumber

Max width in pixels for the flyout.

mobileBreakpointnumber

Mobile breakpoint in pixels for the flyout.

mobileWidthstring

Width for the flyout on mobile.

offsetWPAdminBarboolean

Whether to offset the flyout from the WordPress admin bar.

offsetWPAdminMenuboolean

Whether to offset the flyout from the WordPress admin menu.

onClosefunction

Function to fire on flyout close.

onOpenfunction

Function to fire on flyout open.

positionstring

The position of the flyout, absolute or fixed.

resetScrollOnOpenboolean

Whether to reset scroll on open.

showDividerboolean

Whether or not to show the divider border below title.

simplebarboolean

Whether or not to use SimpleBar on the content.

titlestring

The title of the flyout.

zIndexnumber

z-index of the flyout.

refobject | null

Ref to the component.

Since
  • 1.1.18
Returns:

The Flyout component.

Type: 
JSX.Element
Example
import Flyout from '@gravityforms/components/react/admin/modules/Flyout';

return (
    <Flyout direction="right" title="Flyout title">
        { children }
    </Flyout>
);

Methods

(inner) closeFlyout() → {void}

Closes the flyout and fires the onClose function if passed in.

Since
  • 1.1.18
Returns:
Type: 
void

(inner) getBody() → {JSX.Element}

Returns the body that wrap the children of the flyout.

Since
  • 1.1.18
Returns:
Type: 
JSX.Element

(inner) getCSS() → {string}

Returns the CSS used to handle the width and mobile media query.

Since
  • 1.1.18
Returns:

The CSS for the flyout.

Type: 
string

(inner) getFooter() → {JSX.Element}

Returns the footer of the flyout that contains optional children.

Since
  • 5.7.4
Returns:
Type: 
JSX.Element

(inner) getHeader() → {JSX.Element}

Returns the header of the flyout that contains the title, description, children, and close button.

Since
  • 1.1.18
Returns:
Type: 
JSX.Element

(inner) showFlyout() → {void}

Opens the flyout and fires the onOpen function if passed in.

Since
  • 1.1.18
Returns:
Type: 
void