Element Component
The Element component is the foundational container for all Blueprint compositions. It manages interactive state, provides context for child layers, and handles explosion transformations.
Basic Usage
<Element borderRadius="0.5rem" width="auto" height="auto">
<!-- Child layers go here -->
</Element>
Props
borderRadiusβ Controls the border radius of all child layersexplosionSeparationβ Distance between layers when exploded (default: “10px”)stateβ Interactive state: “default”, “hover”, “pressed”, or “focus”width,heightβ Dimensions of the elementvariantsβ Object defining different visual states with transform properties
Interactive States
Elements can be interactive (responding to user input) or locked to a specific state:
<!-- Interactive element -->
<Element state="default">...</Element>
<!-- Locked to hover state -->
<Element state="hover">...</Element>
Variants and Transforms
Elements support variants for different states with transform properties:
<Element
variants={{
default: {
translateY: "0px",
scale: 1
},
hover: {
translateY: "-2px",
scale: 1.05
},
pressed: {
translateY: "1px",
scale: 0.98
}
}}
>
<!-- layers -->
</Element>
Supported transform properties:
translateX,translateYβ Translation offsetsscaleβ Uniform scaling factorrotateβ Rotation angle (e.g., “45deg”)