Once ports are defined they may also be display as a lists in a compartment (rather than always showing the square-box notation which can be fiddly and leads to clutter, and is only really necessary for classifier-level "dependency wiring" in class-level diagrams or instance-level connections in structure diagrams).
In a Class simply disable the display option Suppress Ports.
In a Component you may additionally disable the display option Supress Interfaces to show the services provided and realised by the Component
Image:

