> 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/it/comandi-powershell/new-udgrid.md).

# New-UDGrid

### Sinossi

La griglia è un sistema a griglia a 12 punti che può adattarsi in base alla dimensione dello schermo che mostra i controlli.

### Sintassi

```powershell
New-UDGrid [-Id <String>] [-ExtraSmallSize <Int32>] [-SmallSize <Int32>] [-MediumSize <Int32>] [-LargeSize <Int32>] [-ExtraLargeSize <Int32>] [-Item] [-Children <ScriptBlock>] [-ClassName <String>] [-Direction <String>] [-RowSpacing <Object>] [-ColumnSpacing <Object>] [-JustifyContent <String>] [-AlignItems <String>] [-Version <String>] [-Style <Hashtable>] [<CommonParameters>]

    New-UDGrid [-Id <String>] [-Container] [-Spacing <Int32>] [-Children <ScriptBlock>] [-ClassName <String>] [-Direction <String>] [-RowSpacing <Object>] [-ColumnSpacing <Object>] [-JustifyContent <String>] [-AlignItems <String>] [-Version <String>] [-Style <Hashtable>] [<CommonParameters>]
```

### Descrizione

Crea una griglia per disporre i componenti. La griglia è un sistema a griglia a 12 punti che può adattarsi in base alla dimensione dello schermo che mostra i controlli.

### Parametri

#### -Id

L'ID del componente. Per impostazione predefinita è un GUID casuale.

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

#### -ExtraSmallSize

La dimensione (1-12) per i dispositivi molto piccoli.

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

#### -SmallSize

La dimensione (1-12) per i dispositivi piccoli.

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

#### -MediumSize

La dimensione (1-12) per i dispositivi medi.

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

#### -LargeSize

La dimensione (1-12) per i dispositivi grandi.

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

#### -ExtraLargeSize

La dimensione (1-12) per i dispositivi molto grandi.

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

    -Container [<SwitchParameter>]
        Whether this is a container. A container can be best described as a row.

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

#### -Spacing

Spaziatura tra gli elementi.

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

    -Item [<SwitchParameter>]
        Whether this is an item in a container.

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

#### -Children

Componenti inclusi in questo elemento della griglia.

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

#### -ClassName

Una classe CSS da applicare alla griglia.

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

#### -Direction

La direzione della griglia. Può essere row, column, row-reverse o column-reverse.

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

#### -RowSpacing La spaziatura tra le righe.Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-ColumnSpacing La spaziatura tra le colonne.Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-JustifyContentL'allineamento degli elementi della griglia lungo l'asse principale. Può essere flex-start, flex-end, center, space-between, space-around o space-evenly.Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-AlignItemsL'allineamento degli elementi della griglia lungo l'asse trasversale. Può essere flex-start, flex-end, center, baseline o stretch.Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-VersionRequired?                    falsePosition?                    namedDefault value                1Accept pipeline input?       falseAliasesAccept wildcard characters?  false-StyleRequired?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false    \<CommonParameters>        This cmdlet supports the common parameters: Verbose, Debug,        ErrorAction, ErrorVariable, WarningAction, WarningVariable,        OutBuffer, PipelineVariable, and OutVariable. For more information, see        about\_CommonParameters (<https://go.microsoft.com/fwlink/?LinkID=113216).Output--------------------------> EXAMPLE 1 --------------------------PS >New-UDGrid -Container -Children {PS >     New-UDGrid -Item -ExtraSmallSize 4 -Children {PS >        New-UDCard -Title "Card 1" -Content {PS >            New-UDButton -Text "Button 1"PS >        }PS >    }PS >     New-UDGrid -Item -ExtraSmallSize 4 -Children {PS >        New-UDCard -Title "Card 1" -Content {PS >            New-UDButton -Text "Button 2"PS >        }PS >    }PS >     New-UDGrid -Item -ExtraSmallSize 4 -Children {PS >        New-UDCard -Title "Card 1" -Content {PS >            New-UDButton -Text "Button 3"PS >        }PS >    }PS > } -Id "grid1"Basic grid|A basic grid with 3 cards in a row\.-------------------------- EXAMPLE 2 --------------------------PS >New-UDGrid -Container -Children {PS >     New-UDGrid -Item -ExtraSmallSize 12 -LargeSize 4 -Children {PS >        New-UDCard -Title "Card 1" -Content {PS >            New-UDButton -Text "Button 1"PS >        }PS >    }PS >     New-UDGrid -Item -ExtraSmallSize 12 -LargeSize 4  -Children {PS >        New-UDCard -Title "Card 1" -Content {PS >            New-UDButton -Text "Button 2"PS >        }PS >    }PS >     New-UDGrid -Item -ExtraSmallSize 12 -LargeSize 4 -Children {PS >        New-UDCard -Title "Card 1" -Content {PS >            New-UDButton -Text "Button 3"PS >        }PS >    }PS > } -Id "grid2"Responsive Grid|A responsive grid with 3 cards in a row. The cards will stack on small device screens.-------------------------- EXAMPLE 3 --------------------------PS >New-UDDynamic -Id 'grid4' -Content {PS >    $Spacing = (Get-UDElement -Id 'gridSpacingSelect').valuePS >    New-UDGrid -Container -Children {PS >      New-UDGrid -Item -ExtraSmallSize 12 -LargeSize 4 -Children {PS >        New-UDCard -Title "Card 1" -Content {PS >            New-UDButton -Text "Button 1"PS >        }PS >    }PS >     New-UDGrid -Item -ExtraSmallSize 12 -LargeSize 4  -Children {PS >        New-UDCard -Title "Card 1" -Content {PS >            New-UDButton -Text "Button 2"PS >        }PS >    }PS >    New-UDGrid -Item -ExtraSmallSize 12 -LargeSize 4 -Children {PS >        New-UDCard -Title "Card 1" -Content {PS >            New-UDButton -Text "Button 3"PS >        }PS >    }PS >   } -Spacing $SpacingPS > }PS > New-UDSelect -Id 'gridSpacingSelect' -Label Spacing -Option {PS >   for ($i = 0; $i -lt 10; $i++) {PS >       New-UDSelectOption -Name $i -Value $iPS >   }PS >} -OnChange { Sync-UDElement -Id 'grid4' } -DefaultValue 3Grid Spacing|A responsive grid with 3 cards in a row. The spacing between the cards can be changed with the select box.-------------------------- EXAMPLE 4 --------------------------PS >New-UDRow -Columns {PS >     New-UDColumn -Size 4 -Content {PS >         New-UDCard -Title "Card 1" -Content {}PS >     }PS >     New-UDColumn -Size 4 -Content {PS >         New-UDCard -Title "Card 2" -Content {}PS >     }PS >     New-UDColumn -Size 4 -Content {PS >         New-UDCard -Title "Card 3" -Content {}PS >     }PS > } -Id 'grid5'Row and Columns|The row and column aliases can be used to create a grid.-------------------------- EXAMPLE 5 --------------------------PS >$Session:direction = 'row'PS > $Session:justifyContent = 'center'PS > $Session:alignItems = 'center'PS > New-UDSelect -Label 'direction' -Option {PS >     New-UDSelectOption -Name 'row'PS >     New-UDSelectOption -Name 'row-reverse'PS >     New-UDSelectOption -Name 'column'PS >     New-UDSelectOption -Name 'column-reverse'PS > } -DefaultValue 'row' -OnChange {PS >     $Session:direction = $EventDataPS >     Sync-UDElement -Id 'example'PS > }PS > New-UDSelect -Label 'justifyContent' -Option {PS >     New-UDSelectOption -Name 'flex-start'PS >     New-UDSelectOption -Name 'center'PS >     New-UDSelectOption -Name 'flex-end'PS >     New-UDSelectOption -Name 'space-between'PS >     New-UDSelectOption -Name 'space-around'PS >     New-UDSelectOption -Name 'space-evenly'PS > } -DefaultValue 'center' -OnChange {PS >     $Session:justifyContent = $EventDataPS >     Sync-UDElement -Id 'example'PS > }PS > New-UDSelect -Label 'alignItems' -Option {PS >     New-UDSelectOption -Name 'flex-start'PS >     New-UDSelectOption -Name 'center'PS >     New-UDSelectOption -Name 'flex-end'PS >     New-UDSelectOption -Name 'stretch'PS >     New-UDSelectOption -Name 'baseline'PS > } -DefaultValue 'center' -OnChange {PS >     $Session:alignItems = $EventDataPS >     Sync-UDElement -Id 'example'PS > }PS > New-UDDynamic -Id 'example' -Content {PS >     New-UDGrid -Container -Children {PS >         New-UDGrid -Item -Children {PS >             New-UDPaper -Children { "Cell 1" } -Style @{PS >                 backgroundColor = 'rgb(26, 32, 39)'PS >                 color           = 'white'PS >             }PS >         }PS >         New-UDGrid -Item -Children {PS >             New-UDPaper -Children { "Cell 2" } -Style @{PS >                 backgroundColor = 'rgb(26, 32, 39)'PS >                 color           = 'white'PS >             }PS >         }PS >         New-UDGrid -Item -Children {PS >             New-UDPaper -Children { "Cell 3" } -Style @{PS >                 backgroundColor = 'rgb(26, 32, 39)'PS >                 color           = 'white'PS >             }PS >         }PS >     } -Direction $Session:Direction -JustifyContent $Session:justifyContent -AlignItems $Session:alignItemsPS > }Alignment|The alignment of the grid items can be changed with the direction, justifyContent and alignItems parameters.\[Component("Grid", "Grid", "Creates a new card.")]


---

# 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 dynamically by asking a question.

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

```
GET https://docs.devolutions.net/powershell-universal/it/comandi-powershell/new-udgrid.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
