Aside
The <Aside>
component is a responsive layout element designed for displaying side content next to main content. It ensures the side content has a fixed width while the main content dynamically adjusts to fill the remaining space.
Usage
Use the <Aside>
for building layouts were you need to have one dynamic main content with a fixed side content. On smaller screens, e.g. on mobile devices, the content is automatically shifted one below the other when 50% of the width is reached. You can also adjust this by setting the wrap
property to a percentage value.
Important
The <Aside>
must have exactly two children, where none is a <Fragment>
.
The example shows a simple <Aside>
component. If you have a look on the code tab you get to know how to set the side
, sideWidth
and space
prop.
Through space
you can define the gap between the contents.
With sideWidth
you define the width for the side content and with side
you define the side on which the side content will appear.
Props
aria-describedby?
string;
aria-details?
string;
aria-label?
string;
aria-labelledby?
string;
aria-live?
"off" | "polite" | "assertive";
- 'off': Updates are not announced unless focused.
- 'polite': Updates are announced when the user is idle.
- 'assertive': Updates are announced immediately, interrupting other announcements.
children
[
ReactElement<any, string | JSXElementConstructor<any>>,
ReactElement<any, string | JSXElementConstructor<any>>,
];
id?
string;
role?
"region" | (string & {});
region
is used as a role, an aria-label
or aria-labelledby
must be provided.
See MDN.side?
"left" | "right";
"left"
sideWidth?
string;
space?
GapSpaceProp;
0
wrap?
NonZeroPercentage;
50%
Alternative components
Grid: When things get more complex the
<Grid>
component is the right choice. It allows you to create complex layouts with multiple columns and rows.Columns: You can position your content in one row with the
<Columns>
component. The component is used to create structured and flexible layouts that organize content efficiently.