2024-03-08 14:13:55 -08:00
|
|
|
---
|
|
|
|
sidebar_position: 12
|
|
|
|
---
|
|
|
|
|
2024-03-12 11:31:46 -07:00
|
|
|
import Playground from '@site/src/components/Playground';
|
|
|
|
|
2024-03-08 14:13:55 -08:00
|
|
|
# Min/Max Width and Height
|
2024-03-12 11:31:46 -07:00
|
|
|
|
2024-03-13 10:19:30 -07:00
|
|
|
These properties set the maximum and minimum size constraints of a node.
|
2024-03-12 11:31:46 -07:00
|
|
|
They have higher priority than all other properties and will always be respected.
|
|
|
|
Constraints can be specified as either absolute pixel values or as percentages of their
|
2024-03-13 10:19:30 -07:00
|
|
|
[containing block's](/docs/advanced/containing-block) size. By default all these constraints are `undefined`.
|
2024-03-12 11:31:46 -07:00
|
|
|
|
|
|
|
<Playground code={`<Layout config={{useWebDefaults: false}}>
|
|
|
|
<Node
|
|
|
|
style={{
|
2024-03-13 10:19:30 -07:00
|
|
|
width: 200,
|
2024-03-12 11:31:46 -07:00
|
|
|
height: 250,
|
2024-03-13 10:19:30 -07:00
|
|
|
padding: 10,
|
2024-03-12 11:31:46 -07:00
|
|
|
}}>
|
|
|
|
<Node style={{margin: 5, height: 25}} />
|
|
|
|
<Node
|
|
|
|
style={{
|
|
|
|
margin: 5,
|
|
|
|
height: 100,
|
2024-03-13 10:19:30 -07:00
|
|
|
maxHeight: 25,
|
|
|
|
}}
|
|
|
|
/>
|
2024-03-12 11:31:46 -07:00
|
|
|
<Node
|
|
|
|
style={{
|
|
|
|
margin: 5,
|
|
|
|
height: 25,
|
2024-03-13 10:19:30 -07:00
|
|
|
minHeight: 50,
|
|
|
|
}}
|
|
|
|
/>
|
2024-03-12 11:31:46 -07:00
|
|
|
<Node
|
|
|
|
style={{
|
|
|
|
margin: 5,
|
|
|
|
height: 25,
|
2024-03-13 10:19:30 -07:00
|
|
|
maxWidth: 25,
|
|
|
|
}}
|
|
|
|
/>
|
2024-03-12 11:31:46 -07:00
|
|
|
<Node
|
|
|
|
style={{
|
|
|
|
margin: 5,
|
|
|
|
height: 25,
|
|
|
|
width: 25,
|
2024-03-13 10:19:30 -07:00
|
|
|
minWidth: 50,
|
|
|
|
}}
|
|
|
|
/>
|
2024-03-12 11:31:46 -07:00
|
|
|
</Node>
|
|
|
|
</Layout>`} />
|