Member-only story

Buefy — Sticky Headers and Footers

John Au-Yeung
3 min readJan 11, 2021

--

Photo by Sophia Baboolal on Unsplash

Buefy is a UI framework that’s based on Bulma.

In this article, we’ll look at how to use Buefy in our Vue app.

Sticky Headers and Columns

We can add the sticky-header prop to show a scrolling table with fixed headers.

For example, we can write:

<template>
<div id="app">
<b-table :data="data" :columns="columns" sticky-header height="100px"></b-table>
</div>
</template>
<script>
export default {
name: "App",
data() {
const data = [
{
id: 1,
first_name: "james",
last_name: "smith"
},
{
id: 2,
first_name: "mary",
last_name: "jones"
},
{
id: 3,
first_name: "alex",
last_name: "wong"
}
];
return {
data,
columns: [
{
field: "id",
label: "ID",
width: "40",
numeric: true
},
{
field: "first_name",
label: "First Name"
},
{
field: "last_name",
label: "Last Name"
}
]
};
}
};
</script>

to add the prop and set the height so that we can see the scrolling content with the sticky header.

--

--

No responses yet