Skip to content
v0.2.10

Popover

A nonmodal contextual dialog in the native top layer.

Preview

Use Popover

Popover is a named export of @flood-md/react. Connect the package once, then import what you use.

First time here? Connect Flood
Example import style
popover.tsxTSX
"use client";

import { FloodRoot, Popover, Button } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <Popover title="Project settings" trigger={trigger => <Button {...trigger}>Settings</Button>}>Project details.</Popover>
    </FloodRoot>
  );
}

Design notes

  • Forward all trigger props and ref.
  • Escape, outside pointer and focus leaving dismiss. Focus enters content and returns when appropriate; Tab is not trapped.
  • Closed content unmounts; keep persistent data in the host. Uses native Popover API within the existing DOM/theme scope.

API reference

PropValuesDefault
titlestringRequired
chrome"default" | "minimal"—
trigger(props: OverlayTriggerProps) => ReactNodeRequired
childrenReactNode—
openboolean—
defaultOpenbooleanfalse
onOpenChange(open: boolean) => void—
disabledbooleanfalse
side"top" | "bottom" | "left" | "right""bottom"
align"start" | "center" | "end""start"
closeLabelstring"Close"
initialFocusRefRefObject<HTMLElement | null>—
positionReferenceRefObject<HTMLElement | null>—
Native HTML propsOmit<HTMLAttributes<HTMLDivElement>, "children" | "title" | "role">Forwarded
View TypeScript source