Box
The Box
component is a flexible and foundational container in Sistent, designed to structure and style content. It provides quick access to the theme and CSS utilities, allowing for easy customization and responsive design. Using the sx prop, developers can apply CSS styles directly with theme-aware properties, making Box ideal for layouts, spacing, and other UI adjustments. It can render as any HTML element using the component prop, offering high versatility in both structure and styling.
Basic Box Example
A simple Box component can be used to contain and structure other elements. Here, the Box serves as a basic container without any styling applied.
This is a basic Box component.
Styled Box Example
You can add custom styles to a Box component by applying sx
properties. In this example, the Box has a background color, padding, and a defined height.
This is a Box component with custom background and padding.
Responsive Box Example
The Box component also supports responsive styling using the sx
prop. In this example, the Box adjusts its padding and background color based on screen size.
This Box is responsive, changing style based on screen size.
Interactive Box Example
Here’s an example where the Box component includes hover effects to create a more interactive experience. This is useful for buttons, cards, and other clickable elements.
Hover over this Box to see the interactive effect.