AccueilComponentsSection

Section

Section de page : centre son contenu dans un conteneur de largeur maximale et applique la marge extérieure du thème (externalPadding). Composant de type Box. Padding horizontal (gauche/droite), toujours appliqué, selon la largeur d’écran : •mobile (< 768px) : 2W = 16px ; •tablette (768–991px) et desktop (≥ 992px) : 3W = 24px. withPaddingY ajoute la même valeur en haut et en bas (désactivé par défaut). Largeur maximale du contenu (size) : sm = 600px, md = 1200px (par défaut), full = sans limite.
core
Experimental
Default
Section
tsx
export const Default = () => (
<Section>
<Box>
<Typography>Section</Typography>
</Box>
</Section>
);
WithPaddingY
Section avec background et padding Y
tsx
export const WithPaddingY = () => (
<Section backgroundColor={paddingColor} withPaddingY>
<Box backgroundColor={innerBoxColor} p="1W">
<Typography>Section avec background et padding Y</Typography>
</Box>
</Section>
);
WidthMdSize
Section avec background et size md (1200px, taille par défaut)
tsx
export const WidthMdSize = () => {
const styles = useStyles();
return (
<Section backgroundColor={paddingColor} size="md">
<Box backgroundColor={innerBoxColor} p="1W">
<Typography>
Section avec background et size md ({styles.sectionContainerMD.maxWidth}px, taille par défaut)
</Typography>
</Box>
</Section>
);
WidthFullSize
Section avec background et size full (sans largeur maximale)
tsx
export const WidthFullSize = () => (
<Section backgroundColor={paddingColor} size="full">
<Box backgroundColor={innerBoxColor} p="1W">
<Typography>Section avec background et size full (sans largeur maximale)</Typography>
</Box>
</Section>
);
WidthSmSize
Section avec background et size sm (600px)
tsx
export const WidthSmSize = () => {
const styles = useStyles();
return (
<Section backgroundColor={paddingColor} size="sm">
<Box backgroundColor={innerBoxColor} p="1W">
<Typography>Section avec background et size sm ({styles.sectionContainerSM.maxWidth}px)</Typography>
</Box>
</Section>
);
};
Alveole UI Kit — v2.0.0-alpha.30