Box (<e-box>
)
The e-box
component is a fundamental layout primitive that acts as a simple block-level container. It provides basic styling options like padding, border, background color, text color, and border radius through CSS custom properties and corresponding element attributes.
Basic Usage
<e-box>This content is inside a Box.</e-box>
Examples
Styled Box: padding="1.5rem" border-width="2px" border-color="blue" radius="0.5rem" bg="slategray" color="white"
Properties
tag
<string>
(Default:undefined
)- Provides a semantic hint (e.g., ‘section’, ‘article’). Does not change the rendered tag. Useful for CSS selectors (
e-box[tag="..."]
). Attribute:tag
.
- Provides a semantic hint (e.g., ‘section’, ‘article’). Does not change the rendered tag. Useful for CSS selectors (
padding
<string>
(Default:0
)- Sets the padding inside the box. Accepts any valid CSS padding value. Maps to
--box-padding
. Attribute:padding
.
- Sets the padding inside the box. Accepts any valid CSS padding value. Maps to
border-width
<string>
(Default:0
)- Sets the border width. Maps to
--box-border-width
. Attribute:border-width
.
- Sets the border width. Maps to
border-color
<string>
(Default:transparent
)- Sets the border color. Maps to
--box-border-color
. Used ifborder
is not set. Attribute:border-color
.
- Sets the border color. Maps to
border
<string>
(Default:unset
)- Sets the border using CSS shorthand. Maps to
--box-border
. Overridesborder-width
andborder-color
. Example:"1px solid black"
. Attribute:border
.
- Sets the border using CSS shorthand. Maps to
radius
<string>
(Default:0
)- Sets the border radius. Maps to
--box-radius
. Attribute:radius
.
- Sets the border radius. Maps to
bg
<string>
(Default:inherit
)- Sets the background color. Maps to
--box-bg
. Attribute:bg
.
- Sets the background color. Maps to
color
<string>
(Default:currentColor
)- Sets the text color. Maps to
--box-color
. Attribute:color
.
- Sets the text color. Maps to