# SiLinkDirective documentation

**Kind:** directive

**Selector:** `[siLink]`

**Exported as:** `siLink`

```
import { SiLinkDirective } from '@siemens/element-ng/link';
```

```
directive SiLinkDirective implements DoCheck, OnChanges, OnDestroy
```

#### Input Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [actionParam](<https://github.com/siemens/element/blob/main/projects/element-ng/link/si-link.directive.ts#L51-L51>) | `any` |  | Parameter passed to the configured link action. |
| [activeClass](<https://github.com/siemens/element/blob/main/projects/element-ng/link/si-link.directive.ts#L53-L53>) | `string \| undefined` |  | CSS class applied while the link is active. |
| [ariaCurrent](<https://github.com/siemens/element/blob/main/projects/element-ng/link/si-link.directive.ts#L63-L63>) | `AriaCurrentType \| undefined` |  | Type for `aria-current` to set if routerLink is active. |
| [exactMatch](<https://github.com/siemens/element/blob/main/projects/element-ng/link/si-link.directive.ts#L59-L59>) | `boolean` | `false` | Whether router links must match the complete URL to be considered active. |
| [siLink](<https://github.com/siemens/element/blob/main/projects/element-ng/link/si-link.directive.ts#L47-L47>) | `Link \| undefined` |  | Link configuration, including the destination, action, and tooltip. |
| [siLinkDefaultTarget](<https://github.com/siemens/element/blob/main/projects/element-ng/link/si-link.directive.ts#L49-L49>) | `string \| undefined` |  | Default target for links configured with an `href` but no explicit target. |

#### Output Properties

| Name | Type | Description |
| --- | --- | --- |
| [activeChange](<https://github.com/siemens/element/blob/main/projects/element-ng/link/si-link.directive.ts#L66-L66>) | `boolean` | Emits when the active state of the link changes. |

#### Attributes and Methods

##### active

[Source for active](<https://github.com/siemens/element/blob/main/projects/element-ng/link/si-link.directive.ts#L76-L76>)

**Modifiers:** readonly

**Type:** `WritableSignal<boolean>`

**Default:** `false`

##### onClick

[Source for onClick](<https://github.com/siemens/element/blob/main/projects/element-ng/link/si-link.directive.ts#L196-L230>)

```
onClick(event: any): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [event](<https://github.com/siemens/element/blob/main/projects/element-ng/link/si-link.directive.ts#L196-L196>) | `any` |  |  |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

### Types Documentation

### [AriaCurrentType](<https://github.com/siemens/element/blob/main/projects/element-ng/link/aria-current.model.ts#L6-L6>)

**Kind:** type alias

```
type AriaCurrentType = 'page' | 'step' | 'location' | 'date' | 'time' | 'true'
```

### [Link](<https://github.com/siemens/element/blob/main/projects/element-ng/link/link.model.ts#L8-L51>)

**Kind:** interface

```
import type { Link } from '@siemens/element-ng/link';
```

```
interface Link
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [action](<https://github.com/siemens/element/blob/main/projects/element-ng/link/link.model.ts#L42-L42>) (optional) | `string \| ((param?: any) => void \| any)` | A function that will be invoked when clicking on the menu item. When passed as a string, use together with SiLinkActionService to receive events. This is meant for repetitive things in lists/tables/etc. |
| [disabled](<https://github.com/siemens/element/blob/main/projects/element-ng/link/link.model.ts#L50-L50>) (optional) | `boolean` | A boolean that lets the link know whether it is disabled or not. |
| [href](<https://github.com/siemens/element/blob/main/projects/element-ng/link/link.model.ts#L22-L22>) (optional) | `string` | Defines a href URI that the menu item will be linked to. Will be used to set the href attribute of the a element. Will only be used if link and function is not set. |
| [isActive](<https://github.com/siemens/element/blob/main/projects/element-ng/link/link.model.ts#L46-L46>) (optional) | `boolean` | A boolean that lets the link know whether it is active or not. It is useful when action() is executed instead of link route. |
| [link](<https://github.com/siemens/element/blob/main/projects/element-ng/link/link.model.ts#L32-L32>) (optional) | `string \| any[]` | Defines the link of the menu item within the application using the angular router link concept. Accepts an array of `any` as per \[routerLink API definition\][https://angular.dev/api/router/RouterLink](<https://angular.dev/api/router/RouterLink>). |
| [navigationExtras](<https://github.com/siemens/element/blob/main/projects/element-ng/link/link.model.ts#L36-L36>) (optional) | `NavigationExtras` | The navigation extras provide additional routing options when using the router link. |
| [target](<https://github.com/siemens/element/blob/main/projects/element-ng/link/link.model.ts#L27-L27>) (optional) | `string` | The target attribute specifies where to open the linked document. If no target is specified, the link will open in the current tab. |
| [title](<https://github.com/siemens/element/blob/main/projects/element-ng/link/link.model.ts#L12-L12>) (optional) | `TranslatableString` | The title of the menu item. Can be either the title to be displayed or the translation key. |
| [tooltip](<https://github.com/siemens/element/blob/main/projects/element-ng/link/link.model.ts#L17-L17>) (optional) | `TranslatableString` | The optional tooltip of the link. Can be either the text to be displayed or the translation key. |

### [TranslatableString](<https://github.com/siemens/element/blob/main/projects/element-translate-ng/translate-types/global.types.ts#L18-L18>)

**Kind:** type alias

```
import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';
```

Represents a translatable string. This can either be a translation key, e.g. `ACTIONS.EDIT` that will be automatically translated when displayed on the UI or a pre-translated string, e.g. `Edit`. Equivalent to a normal string in usage and functionality.

```
type TranslatableString = string & Translatable
```
