Skip to content

Add layout for ModalContainer #222

@FrameMuse

Description

@FrameMuse

This should be used in two cases

Null

External Modal UI library

You should be able to pass null to layout in order to prevent showing any predefined React Elements.

<ModalContainer layout={null} ... />

Custom layout

You should be able to extend and customize ModalContainer, so you may want to remove predefined layout to make ModalContainer behave like modal provider.

Layout

You should be able to replace predefined layout with ease by passing a layout component with children.

interface ModalLayoutProps {
  children: ReactNode
}

function ModalLayout(props: ModalLayoutProps) {
  return (
    <div className="modal-layout">
      {props.children}
    </div>
  )
}

<ModalContainer layout={ModalLayout} ... />

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions