Atoms / Popover

Popover

A panel that opens from a button and holds anything. Built on Base UI.

import { Popover } from "@forgeron/ui";
/01 → Form
import { Button, Field, Input, Popover } from "@forgeron/ui";

export default function Form() {
  return (
    <Popover
      label="Rename"
      title="Rename"
      description="Shown to everyone in the workspace."
      showClose
      trigger={<Button size="sm">Rename</Button>}
    >
      <Field label="Name">
        {(control) => <Input {...control} defaultValue="Quarterly report" />}
      </Field>
    </Popover>
  );
}
API → Props
PropTypeDefaultDescription
triggerReactElement—The control that opens it: one element that takes a ref.
labelstring—Names the panel.
title / descriptionReactNode—A heading and one line inside.
childrenReactNode—The content.
open / defaultOpen / onOpenChangeboolean / boolean / (open) => void—Controlled or not.
side / aligntop | bottom | left | right / start | center | endbottom / startPlacement.
widthnumber—px; the content's own by default.
showClosebooleanfalseA close button in the corner.
modalboolean | "trap-focus"falseLock the page, or keep Tab inside.
classNamestring—Extra classes.