Container
This page demonstrates how to use the is--container class — which sets container-type — through components.
is--container can be applied via the isContainer property on any component.
| Property | Output |
|---|---|
isContainer | .is--container |
A dedicated <Container> component is also available as an alias for <Lism isContainer>.
This section introduces that dedicated component.
Props
The following props are available on <Container>.
| Property | Description |
|---|---|
layout | Specifies the Layout module to expand into. |
↓
The examples ① and ② below produce the same result.
// ①<Flow isContainer>...</Flow>
// ②<Container layout='flow'>...</Container>Import
import { Container } from 'lism-css/react'; Usage
When isContainer is set on a Lism component, or when the <Container> component is used, the is--container class is applied and container queries become active inside the element.
↓
Example
This Box switches its padding based on the container size.
リサイズ可能
<Container isWrapper='s' p='20'> <Box bd p={['10','30']}>This Box switches its padding based on the container size.</Box></Container>