Popover

A floating panel opened from a button, and the parts popouts are built from: a section label, a separator, a search field and a person row. Built on ui-sdk's Popover: Escape and an outside press close it, focus returns to the trigger, and it opens in the top layer.

BetaReady to use. Its API can still change in a minor release; the changelog says when.

import { Popover, PopoverTrigger, PopoverContent } from "@leap-crm/design-system";

Playground

Change a prop and the component follows. Its code is under Props.

Props

side
align

Best practices

When to use it, and the rules that apply in particular places.

GuidancePractice
DoUse it for a small panel tied to a control, like sharing an opportunity, where the rest of the page stays usable while it is open.
DoName it with PopoverTitle, and close it from its own actions with PopoverClose. Focus returns to the trigger when it closes.
DoFor a list of rows, pass className="w-56 p-0" and build it from PopoutSearch, PopoutSectionLabel, PopoutSeparator and PopoutPersonRow.
DoGive PopoutSearch an aria-label, like Search people. The placeholder is not a name.
DoKeep a custom row's corners smaller than the panel's, as PopoutPersonRow does, and put its selection tick on the right.
Don'tUse it for a list of actions on a record. Use DropdownMenu, which adds arrow keys, typeahead and the menu role.

Props

Popover also takes ui-sdk's options (open, defaultOpen, onOpenChange, modal, openOnHover, delay, presentation, controller). PopoverContent takes its position and focus props (side, alignOffset, collisionPadding, anchor, initialFocus, finalFocus, keepMounted), and PopoverTrigger and PopoverClose take render.

Popover

No props of its own.

PopoverContent

PropTypeDefaultDescription
childrenReactNode—What it shows inside.
classNamestring—Classes added to the root element, merged with its own. Tokens only.
alignunknown"center"How it lines up along that side: start, center or end.
sideOffsetunknown4The gap between it and what it opens from, in pixels.

PopoverTitle

PropTypeDefaultDescription
classNamestring—Classes added to the root element, merged with its own. Tokens only.

PopoverDescription

PropTypeDefaultDescription
classNamestring—Classes added to the root element, merged with its own. Tokens only.

PopoutSectionLabel

No props of its own.

PopoutSeparator

No props of its own.

PopoutSearch

PropTypeDefaultDescription
aria-label *string—Names the field for screen readers; the placeholder is not a name.
placeholderunknown"Search…"Grey hint text while it's empty. Never a replacement for a label.

PopoutPersonRow

PropTypeDefaultDescription
name *string—The person's name, on the row's first line.
detailstring—The grey second line, like "Client · ada@hartley.com".
initialsstring—Two letters for the avatar. From the name when left out.
selectedbooleanfalseShows the navy tick on the right.

Code

What the playground shows, ready to copy.

import {
  Button,
  Popover,
  PopoverContent,
  PopoverDescription,
  PopoverTitle,
  PopoverTrigger,
} from "@leap-crm/design-system";

<Popover>
  <PopoverTrigger render={<Button intent="outline">Share</Button>} />
  <PopoverContent>
    <PopoverTitle>Share this opportunity</PopoverTitle>
    <PopoverDescription>
      Anyone at the firm with the link can open it.
    </PopoverDescription>
  </PopoverContent>
</Popover>

Panel

A title, a description and actions. PopoverClose closes it from inside; focus goes back to Share.

Popout

A list of rows: a search field with a rule under it, quiet section labels, dividers between groups, and two-line person rows with a navy tick on the selected one. Pass className="w-70 p-0" to drop the panel's padding.

Popout parts

Each part on its own: Section label (12/16, 450, muted), Separator (the divider colour, 4 px above and below), Search (36 px) and Person row (48 px; highlighted as data-highlighted).

Recent
Ada HartleyClient · ada@hartley.com
Ben OkaforOther side · ben@okafor.law
Chloe NguyenStaff · Conveyancing

What the examples share

The imports and the scaffolding the examples above call. The scaffolding lives in this page, not in the library.

import { Link2, UserPlus } from "lucide-react";

import { Button, PopoutPersonRow, PopoutSearch, PopoutSectionLabel, PopoutSeparator, Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger } from "@leap-crm/design-system";

const recent = [
  { name: "Ada Hartley", detail: "Client · ada@hartley.com", selected: true },
  { name: "Ben Okafor", detail: "Other side · ben@okafor.law" },
] as const;

const everyone = [
  { name: "Chloe Nguyen", detail: "Staff · Conveyancing" },
  { name: "Dev Patel", detail: "Staff · Family law" },
] as const;

function SharePanel() {
  return (
    <Popover>
      <PopoverTrigger
        render={
          <Button intent="outline" icon={<Link2 />}>
            Share
          </Button>
        }
      />
      <PopoverContent>
        <div className="flex flex-col gap-3">
          <div className="flex flex-col gap-1">
            <PopoverTitle>Share this opportunity</PopoverTitle>
            <PopoverDescription>
              Anyone at the firm with the link can open it.
            </PopoverDescription>
          </div>
          <div className="flex justify-end gap-2">
            <PopoverClose
              render={
                <Button intent="ghost" size="sm">
                  Cancel
                </Button>
              }
            />
            <PopoverClose render={<Button size="sm">Copy link</Button>} />
          </div>
        </div>
      </PopoverContent>
    </Popover>
  );
}

Keyboard

The keys it answers to. Tab moves between components, arrows move within them.

KeysWhat they do
EnterSpaceOpen the popover from its trigger.
TabMoves through the popover in order; from the last element, moves to the element after the trigger.
Shift + TabFrom the first element, returns focus to the trigger.
EscapeCloses the popover and returns focus to the trigger.