> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/da/powershell-kommandoer/new-udchip.md).

# New-UDChip

New-UDChip opretter et kompakt PowerShell Universal-element, der repræsenterer et input, en attribut eller en handling, med valgfrit ikon, avatar eller sletteknap.

### Synopsis

Chips er kompakte elementer, der repræsenterer et input, en attribut eller en handling.

### Syntaks

```powershell
New-UDChip [-Id <String>] [[-Label] <String>] [[-OnDelete] <Endpoint>] [[-OnClick] <Endpoint>] [[-Icon] <Object>] [[-Style] <Hashtable>] [[-Variant] <String>] [[-Size] <String>] [-ClassName <String>] [-Color <String>] [<CommonParameters>]

New-UDChip [-Id <String>] [[-Label] <String>] [[-OnDelete] <Endpoint>] [[-OnClick] <Endpoint>] [[-Style] <Hashtable>] [[-Variant] <String>] [[-Avatar] <String>] [[-AvatarType] <String>] [[-Size] <String>] [-ClassName <String>] [-Color <String>] [<CommonParameters>]
```

### Beskrivelse

Chips er kompakte elementer, der repræsenterer et input, en attribut eller en handling.

### Parametre

#### -Id

Id for komponenten. Standardværdien er et tilfældigt GUID.

```
Required?                    false
Position?                    named
Default value                ([Guid]::NewGuid()).ToString()
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Label

Etiketten til chippen.

```
Required?                    false
Position?                    1
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -OnDelete

En scriptblok, der skal kaldes, når chippen slettes.

```
Required?                    false
Position?                    9
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -OnClick

En scriptblok, der skal kaldes, når der klikkes på chippen.

```
Required?                    false
Position?                    8
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Icon

Et ikon, der skal vises i chippen.

```
Required?                    false
Position?                    2
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Style

CSS-typografier, der skal anvendes på chippen.

```
Required?                    false
Position?                    3
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Variant

Den temavariant, der skal anvendes på chippen.

```
Required?                    false
Position?                    4
Default value                default
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Avatar

En avatar, der skal vises i chippen.

```
Required?                    false
Position?                    5
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -AvatarType

Den type avatar, der skal vises i chippen.

```
Required?                    false
Position?                    6
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Size

Størrelsen på chippen. Gyldige værdier er: "small", "medium"

```
Required?                    false
Position?                    10
Default value                medium
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -ClassName

En CSS-klasse, der skal anvendes på chippen.

```
Required?                    false
Position?                    named
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Color

Farven på chippen. Standardværdien er 'default'. Gyldige værdier: "default", "primary", "secondary"

```
Required?                    false
Position?                    named
Default value                default
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### Fælles parametre

Denne cmdlet understøtter de fælles parametre: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable og OutVariable. Se [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216) for at få flere oplysninger.

### Output

### Eksempler

#### Eksempel 1: grundlæggende chip

```powershell
New-UDChip -Label 'Basic' -Icon (New-UDIcon -Icon 'user') -Id 'chip1'
```

En grundlæggende chip med et ikon.

#### Eksempel 2: kontureret chip

```powershell
New-UDChip -Variant outlined -Label 'Outlined' -Icon (New-UDIcon -Icon 'user') -Id 'chip2'
```

En kontureret chip med et ikon.

#### Eksempel 3: klikbar chip

```powershell
New-UDChip -Label 'Clickable' -Icon (New-UDIcon -Icon 'user') -OnClick {
   Show-UDToast -Message 'Hello!'
} -Id 'chip3'
```

En klikbar chip med et ikon.

#### Eksempel 4: sletbar chip

```powershell
New-UDChip -Label 'Deletable' -Icon (New-UDIcon -Icon 'user') -OnDelete {
   Show-UDToast -Message 'Deleted!'
} -Id 'chip4'
```

En sletbar chip med et ikon.

#### Eksempel 5: klikbar og sletbar chip

```powershell
New-UDChip -Label 'Clickable and deletable' -Icon (New-UDIcon -Icon 'user') -OnClick {
   Show-UDToast -Message 'Hello!'
} -OnDelete {
   Show-UDToast -Message 'Deleted!'
} -Id 'chip5'
```

En klikbar og sletbar chip med et ikon.

#### Eksempel 6: avatar-chip

```powershell
New-UDChip -Avatar "A" -AvatarType letter -Label 'Avatar' -Id 'chip6'
```

En chip med en avatar.

#### Eksempel 7: billedchip

```powershell
New-UDChip -Avatar "https://picsum.photos/200/300" -AvatarType image -Label 'Avatar' -Id 'chip7'
```

En chip med et avatarbillede.

#### Eksempel 8: lille chip

```powershell
New-UDChip -Label 'Small' -Icon (New-UDIcon -Icon 'user') -Size small -Id 'chip8'
```

En lille chip med et ikon.

#### Eksempel 9

```powershell
New-UDChip -Style @{background = 'red'; color = 'white'} -Label 'Styled' -Icon (New-UDIcon -Icon 'user') -Id 'chip9'
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/powershell-universal/da/powershell-kommandoer/new-udchip.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
