# Component Diagram

## Create Component Diagram

To create a Component Diagram:

1. Select first an element where a new Component Diagram to be contained as a child.
2. Select **Model | Add Diagram | Component Diagram** in Menu Bar or select **Add Diagram | Component Diagram** in Context Menu.

> **See also**
>
> [UML Component Diagram](http://www.uml-diagrams.org/component-diagrams.html) - For more information about UML Component Diagram.

## Component

To create a Component:

1. Select **Component** in **Toolbox**.
2. Drag on the diagram as the size of Component.

To create a Component (model element only) by Menu:

1. Select an Element where a new Component to be contained.
2. Select **Model | Add | Component** in Menu Bar or **Add | Component** in Context Menu.

You can use **QuickEdit** for Component by double-click or press `Enter` on a selected Component.

* **Name Expression** : Edit name expression.

  *Syntax of Name Expression*

  ```
  expression ::= [ '<<' stereotype `>>` ] [ visibility ] name
  stereotype ::= (identifier)
  visibility ::= '+' | '#' | '-' | '~'
  name ::= (identifier)
  ```
* **Visibility** : Change visibility property.
* **Add Note** : Add a linked note.
* **Add Attribute** (`Ctrl+Enter`) : Add an attribute.
* **Add Operation** (`Ctrl+Shift+Enter`) : Add an operation.
* **Add Reception** : Add a reception.
* **Add Provided Interface** : Add a provided interface.
* **Add Required Interface** : Add a required interface.
* **Add Port** : Add a port.
* **Add Part** : Add a part.

To suppress Attributes, see [Suppress Attributes](/v3/user-guide/formatting-diagram.md#suppress-attributes).

To suppress Operations, see [Suppress Operations](/v3/user-guide/formatting-diagram.md#suppress-operations).

To show or hide Operation Signatures, see [Show Operation Signature](/v3/user-guide/formatting-diagram.md#show-operation-signature).

## Artifact

To create a Artifact:

1. Select **Artifact** in **Toolbox**.
2. Drag on the diagram as the size of Artifact.

To create a Artifact (model element only) by Menu:

1. Select an Element where a new Artifact to be contained.
2. Select **Model | Add | Artifact** in Menu Bar or **Add | Artifact** in Context Menu.

You can use **QuickEdit** for Classifier (See [Classifier](/v3/working-with-diagrams/class-diagram.md#classifier)).

To suppress Attributes, see [Suppress Attributes](/v3/user-guide/formatting-diagram.md#suppress-attributes).

To suppress Operations, see [Suppress Operations](/v3/user-guide/formatting-diagram.md#suppress-operations).

To show or hide Operation Signatures, see [Show Operation Signature](/v3/user-guide/formatting-diagram.md#show-operation-signature).

## Component Realization

To create an Component Realization:

1. Select **Component Realization** in **Toolbox**.
2. Drag from an element (realizing) and drop on a Component (to be realized).

You can use **QuickEdit** for Relationship (See [Relationship](/v3/working-with-diagrams/class-diagram.md#relationship)).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.staruml.io/v3/working-with-diagrams/component-diagram.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
