2024-11-26 11:59:11 +00:00
< script setup lang = "ts" >
2024-12-04 15:06:34 +00:00
import Card from '~/components/ui/Card.vue'
import Alert from '~/components/ui/Alert.vue'
import Layout from '~/components/ui/Layout.vue'
import Tab from '~/components/ui/Tab.vue'
import Tabs from '~/components/ui/Tabs.vue'
2024-11-26 11:59:11 +00:00
< / script >
# Layout
The following containers are responsive. Change your window's size or select a device preset from your browser's dev tools to see how layouts are affected by available space.
2024-12-04 15:06:34 +00:00
< Tabs >
< Tab title = "Flex (default)" icon = "⠖" >
2024-11-26 11:59:11 +00:00
Items are laid out in a row and wrapped as they overflow the container.
By default, all items in a row assume the same (maximum) height.
```vue-html
< Layout flex >
< Card title = "A" style = "width:100px; min-width:100px" > < / Card >
< Card title = "B" :tags = "['funk', 'dunk', 'punk']" > < / Card >
< Card title = "C" style = "width:100px; min-width:100px" > < / Card >
< Card title = "D" > < / Card >
< / Layout >
```
2024-12-04 15:06:34 +00:00
< div class = "preview" >
2024-11-26 11:59:11 +00:00
< Layout flex >
< Card title = "A" style = "width:100px; min-width:100px" > < / Card >
< Card title = "B" :tags = "['funk', 'dunk', 'punk']" > < / Card >
< Card title = "C" style = "width:100px; min-width:100px" > < / Card >
< Card title = "D" > < / Card >
< / Layout >
< / div >
::: info Use additional `flexbox` properties
Find a list of all styles here: [Flexbox guide on css-tricks.com ](https://css-tricks.com/snippets/css/a-guide-to-flexbox/ )
< Layout flex >
2024-12-04 15:06:34 +00:00
< div class = "preview" style = "font-size:11px; font-weight:bold; mix-blend-mode:luminosity;" >
< Layout flex style = "--gap: 4px;" > --gap: 4px
< Alert style = "align-self: flex-end" > align-self: flex-end< / Alert >
< Alert style = "flex-grow: 1" > flex-grow: 1< / Alert >
< Alert style = "height: 5rem;" > height: 5rem< / Alert >
< Alert style = "width: 100%" > width: 100%< / Alert >
< / Layout >
< / div >
2024-11-26 11:59:11 +00:00
< / Layout >
:::
2024-12-04 15:06:34 +00:00
< / Tab >
< Tab title = "Grid" icon = "ꖛ" >
2024-11-26 11:59:11 +00:00
Align items both vertically and horizontally
##### Override the `:column-width` (in px):
< Layout flex >
```vue-html{1}
< Layout grid :column-width = 90 >
< Alert > A< / Alert >
< Alert > B< / Alert >
...
< / Layout >
```
< div class = "preview" >
< Layout grid :column-width = 90 >
< Alert > A< / Alert >
< Alert > B< / Alert >
< Alert > C< / Alert >
< Alert > D< / Alert >
< Alert > E< / Alert >
< Alert > F< / Alert >
< Alert > G< / Alert >
< / Layout >
< / div >
< / Layout >
##### Let elements span multiple rows or columns:
```vue-html{2,4}
< Layout grid >
< Card title = "A" class = "span-2-columns" > < / Card >
< Card title = "B" > < / Card >
< Card title = "C" class = "span-2-rows" > < / Card >
< Card title = "D" > < / Card >
< / Layout >
```
< Layout grid >
< Card title = "A" class = "span-2-columns" >
```vue
< Card class = "span-2-columns" > < / Card >
```
< / Card >
< Card title = "B" > < / Card >
< Card title = "C" class = "span-2-rows" >
```vue
< Card class = "span-2-rows" > < / Card >
```
< / Card >
< Card title = "D" > < / Card >
< / Layout >
2024-12-04 15:06:34 +00:00
< / Tab >
2024-11-26 11:59:11 +00:00
2024-12-04 15:06:34 +00:00
< Tab title = "Stack" icon = "𝌆" >
2024-11-26 11:59:11 +00:00
Add space between vertically stacked items
< Layout flex >
```vue-html
< Layout stack >
< Card title = "A" > < / Card >
< Card title = "B" > < / Card >
< Card title = "C" > < / Card >
< Card title = "D" > < / Card >
< Card title = "E" > < / Card >
< / Layout >
```
< div class = "preview" >
< Layout stack >
< Card title = "A" > < / Card >
< Card title = "B" > < / Card >
< Card title = "C" > < / Card >
< Card title = "D" > < / Card >
< Card title = "E" > < / Card >
< / Layout >
< / div >
< / Layout >
2024-12-04 15:06:34 +00:00
< / Tab >
2024-11-26 11:59:11 +00:00
2024-12-04 15:06:34 +00:00
< / Tabs >