+ This is a Box component with custom background and padding. +
++ This Box is responsive, changing style based on screen size. +
++ This Box is responsive, changing style based on screen size. +
+Hover over this Box to see the interactive effect.
+
+ 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.
+
+ 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.
+
+ 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. +
+
+ 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. +
++ 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. +
++ The Box component is a flexible, theme-aware container that adapts + seamlessly across various layouts. It provides a convenient way to + apply styles, positioning, and responsive adjustments to content, + making it ideal for any layout needs. +
++ The Box component is a highly versatile tool that can be used for + layout management, spacing, styling, and more. With full support for + responsive design, Box is an essential part of any well-structured + application, allowing developers to customize and style elements + while keeping the theme consistent. +
+ + +The Box component serves several functions:
+ +
+ The sx
prop makes it easy to apply responsive styles
+ directly within the component, allowing for adaptive design that
+ looks great across all screen sizes.
+
+ This is a responsive Box component. +
++ Box can serve as a container for organizing other elements, whether + it's aligning text, images, or interactive components. The + flexibility of the Box component allows it to adapt to a wide range + of layout needs, from card-style containers to more complex nested + structures. +
+ +
+ The Box component’s customization options allow you to adjust
+ colors, borders, shadows, and more through the sx
prop,
+ ensuring that components blend well with your app's overall theme.
+
+ Customized Box with shadow and color. +
++ Use Box to create nested layouts by embedding one Box within + another, each with distinct styling. This setup enables the creation + of structured and multi-layered designs. +
+Nested Box layout example.
++ Leveraging Box for margin and padding adjustments offers + fine-grained control over spacing between components, making it + useful in complex layouts where alignment and spacing are crucial. +
+ ++ Box can also be used as an interactive element, handling events and + managing state. This makes it ideal for use cases that require + dynamic behavior or user interaction. +
+ +
+ The Box component seamlessly integrates with Sistent’s responsive
+ design principles, providing a cohesive experience across various
+ screen sizes by leveraging breakpoints in the sx
prop.
+
+ The Box
component is a versatile, theme-aware container
+ in Sistent, ideal for styling and layout customization. It supports
+ the sx prop for easy, responsive styling and can render as any HTML
+ element.
+
+ 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.
+
+ The Box component differs from other containers available in Sistent
+ in that its usage is intended to be multipurpose and open-ended,
+ just like a `div`
. Components like Container, Stack and
+ Paper, by contrast, feature usage-specific props that make them
+ ideal for certain use cases: Container for main layout orientation,
+ Stack for one-dimensional layouts, and Paper for elevated surfaces.
+
+ The Box component renders as a `div`
by default, but
+ you can swap in any other valid HTML tag or React component using
+ the component prop. The demo below replaces the `div`
+ with a `section`
element:
+
+ The Box component can be styled flexibly with Sistent
+ sx
prop and custom themes. The sx prop allows quick
+ application of CSS styles that are theme-aware, enabling responsive
+ and consistent design.
+
+ The sx prop supports a wide range of style properties, including + colors, spacing, and responsive adjustments. It directly accesses + theme values, allowing you to apply theme-based styles to a Box with + minimal code. +
+