AstrolUI AstrolUI
Yellow Orange Red Green Blue Purple Custom color
Light mode
Box

1. Demo AstrolBox

Base
White
Black
Blue
Green
Orange
Red
Yellow
Purple
Base
White
Black
Blue
Green
Orange
Red
Yellow
Purple

Hello World!

@using Astrol.Entities.Basic.UI
@using Astrol.Component.Basic.Box
<AstrolBox Style="AstrolStyle.Base">Base</AstrolBox>
<AstrolBox Style="AstrolStyle.White">White</AstrolBox>
<AstrolBox Style="AstrolStyle.Black">Black</AstrolBox>
<AstrolBox Style="AstrolStyle.Blue">Blue</AstrolBox>
<AstrolBox Style="AstrolStyle.Green">Green</AstrolBox>
<AstrolBox Style="AstrolStyle.Orange">Orange</AstrolBox>
<AstrolBox Style="AstrolStyle.Red">Red</AstrolBox>
<AstrolBox Style="AstrolStyle.Yellow">Yellow</AstrolBox>
<AstrolBox Style="AstrolStyle.Purple">Purple</AstrolBox>
<!-- Outline -->
<AstrolBox Style="AstrolStyle.Base" Outline="true">Base</AstrolBox>
<AstrolBox Style="AstrolStyle.White" Outline="true">White</AstrolBox>
<AstrolBox Style="AstrolStyle.Black" Outline="true">Black</AstrolBox>
<AstrolBox Style="AstrolStyle.Blue" Outline="true">Blue</AstrolBox>
<AstrolBox Style="AstrolStyle.Green" Outline="true">Green</AstrolBox>
<AstrolBox Style="AstrolStyle.Orange" Outline="true">Orange</AstrolBox>
<AstrolBox Style="AstrolStyle.Red" Outline="true">Red</AstrolBox>
<AstrolBox Style="AstrolStyle.Yellow" Outline="true">Yellow</AstrolBox>
<AstrolBox Style="AstrolStyle.Purple" Outline="true">Purple</AstrolBox>
<!-- Custom content -->
<AstrolBox Style="AstrolStyle.Green" Outline="true">
   <h1>
       <Astrol.Component.Basic.Icon.AstrolIcon Icon="astrol-emo-sunglasses" />
       Hello World!
   </h1>
</AstrolBox>

Supported parameters

  • ChildContent (RenderFragment?): HTML content of the box.
  • Style (AstrolStyle): color of the box (default is AstrolStyle.Base).
    • Base (enum)
    • White (enum)
    • Black (enum)
    • Red (enum)
    • Orange (enum)
    • Green (enum)
    • Blue (enum)
    • Yellow (enum)
    • Purple (enum)
  • Outline (bool): shows the box without fill, only with the border and text in the chosen color (default is false).
  • BorderRadius (string): border radius of the box (default: the theme radius, 6px).
  • Class (string?): additional CSS class (not required).
  • AdditionalClasses (IEnumerable<string>?): additional CSS classes added together with Class (not required).
  • OnClick (EventCallback<MouseEventArgs>): action when the box is clicked (not required). The box is a div: it cannot receive focus or be activated with the keyboard, so use AstrolButton for actions.
Markdown for AI © 2026 AstrolUI v10.0.13