2024-12-19 23:30:46 +00:00
|
|
|
<script setup>
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
|
|
|
import Card from '~/components/ui/Card.vue'
|
|
|
|
import Alert from '~/components/ui/Alert.vue'
|
|
|
|
import Layout from '~/components/ui/Layout.vue'
|
|
|
|
import Spacer from '~/components/ui/layout/Spacer.vue'
|
|
|
|
import Tab from '~/components/ui/Tab.vue'
|
|
|
|
import Tabs from '~/components/ui/Tabs.vue'
|
|
|
|
import Toggle from '~/components/ui/Toggle.vue'
|
|
|
|
import Button from '~/components/ui/Button.vue'
|
|
|
|
|
|
|
|
const isGrowing = ref(true)
|
|
|
|
const noGap = ref(true)
|
|
|
|
</script>
|
|
|
|
|
|
|
|
🡔 [Layout](../layout)
|
|
|
|
|
|
|
|
# Layout `columns`
|
|
|
|
|
|
|
|
Let items flow like words on a printed newspaper, Great for very long lists of buttons or links.
|
|
|
|
|
|
|
|
<Layout stack no-gap>
|
|
|
|
|
|
|
|
```vue-html
|
|
|
|
<Layout columns :column-width="120">
|
|
|
|
<Button icon="bi-star"/>
|
|
|
|
<Button icon="bi-star"/>
|
|
|
|
<Button icon="bi-star"/>
|
|
|
|
|
|
|
|
Normal paragraph. Text flows like in a newspaper. Set the column width in px. Columns will be equally distributed over the width of the container.
|
|
|
|
|
2024-12-22 20:19:49 +00:00
|
|
|
<Card min-content title="Cards...">...break over columns...</Card>
|
2024-12-19 23:30:46 +00:00
|
|
|
|
|
|
|
<Button icon="bi-star"/>
|
|
|
|
<Button icon="bi-star"/>
|
|
|
|
<Button icon="bi-star"/>
|
|
|
|
</Layout>
|
|
|
|
```
|
|
|
|
|
|
|
|
<div class="preview">
|
|
|
|
<Layout columns :column-width="120">
|
|
|
|
<Button icon="bi-star"/>
|
|
|
|
<Button icon="bi-star"/>
|
|
|
|
<Button icon="bi-star"/>
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
Normal paragraph. Text flows like in a newspaper. Set the column width in px. Columns will be equally distributed over the width of the container.
|
|
|
|
|
|
|
|
---
|
|
|
|
|
2024-12-22 20:19:49 +00:00
|
|
|
<Card min-content title="Cards...">...break over columns...</Card>
|
2024-12-19 23:30:46 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
<Button icon="bi-star"/>
|
|
|
|
<Button icon="bi-star"/>
|
|
|
|
<Button icon="bi-star"/>
|
|
|
|
</Layout>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</Layout>
|
|
|
|
|
|
|
|
Make sure that all elements fit the column width, else they will leak into the neighboring columns.
|
|
|
|
|
|
|
|
### `no-rule`: Remove the rule (thin line) between columns
|
|
|
|
|
|
|
|
<Layout grid>
|
|
|
|
|
|
|
|
```vue-html
|
|
|
|
<Layout columns :colummn-width="50">
|
|
|
|
<div>Lorem ipsum dolor sit amet.</div>
|
|
|
|
</Layout>
|
|
|
|
|
|
|
|
<Layout columns :colummn-width="50" no-rule>
|
|
|
|
<div>Lorem ipsum dolor sit amet.</div>
|
|
|
|
</Layout>
|
|
|
|
```
|
|
|
|
|
|
|
|
<Layout class="preview">
|
|
|
|
<Layout columns :column-width="40">
|
|
|
|
<div>Lorem ipsum dolor sit amet.</div>
|
|
|
|
</Layout>
|
|
|
|
|
|
|
|
<Layout columns no-rule :column-width="40">
|
|
|
|
<div>Lorem ipsum dolor sit amet.</div>
|
|
|
|
</Layout>
|
|
|
|
</Layout>
|
|
|
|
|
|
|
|
</Layout>
|
|
|
|
|
|
|
|
### Tricks
|
|
|
|
|
|
|
|
#### Prevent column breaks
|
|
|
|
|
|
|
|
Add the following style to the element that you want to preserve whole:
|
|
|
|
|
|
|
|
```css
|
|
|
|
style="break-inside: avoid;"
|
|
|
|
```
|