# New-HTMLPanel

Creates a new HTML panel with customizable styling options.

Project

PSWriteHTML

Generate HTML reports, dashboards, and emails from PowerShell without writing HTML, CSS, or JavaScript.

[View on GitHub](https://github.com/EvotecIT/PSWriteHTML) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteHTML/releases/tag/v1.41.0) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteHTML/1.40.0)

Stars **1,025**

Forks **114**

Open issues 

PowerShell Gallery downloads **7,576,901**

Release **v1.45.0**

Language: PowerShell Updated: 2026-11-19

Command 

**Module**

`PSWriteHTML`

Creates a new HTML panel with customizable styling options.

## Syntax

```
New-HTMLPanel
[-AlignContentText <center|left|right|justify>]
[-AnchorName <String>]
[-BackgroundColor <String>]
[-BorderRadius <String>]
[[-Content] <ScriptBlock>]
[-Density <Spacious|Comfortable|Compact|Dense|VeryDense>]
[-Height <Object>]
[-Invisible]
[-Margin <String>]
[-StyleSheetsConfiguration <IDictionary>]
[-Width <String>]
[<CommonParameters>]
```

[#](#method-new-htmlpanel-string-string-string-string-scriptblock-string-object-switchparameter-string-idictionary-string)

Parameter set: `All Parameter Sets`

## Description

The New-HTMLPanel function creates a new HTML panel with various styling options such as background color, width, margin, alignment, and more.

## Examples

### Example 1

```powershell
New-HTMLPanel -Content { "This is the content of the panel" } -BackgroundColor "lightblue" -Width "50%" -Margin "10px" -AlignContentText "center" -BorderRadius "5px" -AnchorName "myPanel" -StyleSheetsConfiguration @{ Panel = "customPanel" }
```

Creates a new HTML panel with specified content, background color, width, margin, alignment, border radius, anchor name, and custom style sheet configuration.

## Parameters

**-AlignContentText String optional**

Specifies the alignment of the content within the panel.

Possible values: `center`, `left`, `right`, `justify`

**-AnchorName String optional**

Specifies the anchor name of the panel.

**-BackgroundColor String optionalaliases: BackgroundShade**

Specifies the background color of the HTML panel.

**-BorderRadius String optional**

Specifies the border radius of the panel.

Possible values: `0px`, `5px`, `10px`, `15px`, `20px`, `25px`

**-Content ScriptBlock optionalposition: 0**

Specifies the content of the HTML panel as a ScriptBlock.

**-Density String optional**

Specifies the density of the panel. This will automatically enable responsive wrapping for the panel. The options are: Spacious, Comfortable, Compact, Dense, VeryDense.

Possible values: `Spacious`, `Comfortable`, `Compact`, `Dense`, `VeryDense`

**-Height Object optional**

**-Invisible SwitchParameter optional**

Indicates whether the panel should be invisible.

**-Margin String optional**

Specifies the margin of the panel.

**-StyleSheetsConfiguration IDictionary optional**

Specifies the style sheets configuration for the panel.

**-Width String optionalaliases: flex-basis**

Specifies the width of the panel.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:7AA5B53C14C6B1BD7DFBD2CB9BAA840FFC4D1F9D89F2A8003F80EF08850612CE -->
