Each UML diagram has a contents area. As an option, some diagrams may also have a frame (shown as rectangle) with frame heading. The frame could be used in the cases when the diagrammed element has some owned elements that are attached to the border, like ports for classes and components, and entry/exit points on state machines.
    The heading of a frame represents the kind, name, and parameters of the element owning or namespace enclosing the elements represented in the contents area.
    frame-heading ::= [ element-kind ] element-name [ parameters ]
    element-kind ::= short-element-kind | long-element-kind
    The following UML elements and namespaces could have frames:

    Short kind Long kind - owning element or enclosing namespace
    act activity
    class class
    cmp component
    dep deployment
    sd interaction
    pkg package
    stm state machine
    uc use case

    Note, that it is a common mistake to assume that frame kind specifies type of the depicted UML diagram. In fact, type of the diagram is defined by the primary graphical elements shown in the contents area of the diagram. Frame kind is kind of the UML element owning or namespace enclosing the elements shown in the frame contents area.
    For example, we may have framed class diagram of a package:
    Element Frame - 图1
    Framed class diagram of a package org.hibernate.jdbc.
    UML use case could own activities or state machines. Example below shows activity owned by a use case.
    Element Frame - 图2
    Use case Search Items rendered as frame with
    associated Search Items
    activity diagram

    https://www.uml-diagrams.org/frame.html