Skip to content

Commit

Permalink
[ui] Add LoadingSpinner component
Browse files Browse the repository at this point in the history
Adds a component to display a loading spinner and an optional
loading message.

Signed-off-by: Eva Millán <[email protected]>
  • Loading branch information
evamillan authored and jjmerchante committed Aug 9, 2024
1 parent 51f29eb commit b83dc3c
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
24 changes: 24 additions & 0 deletions ui/src/components/LoadingSpinner.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import LoadingSpinner from "./LoadingSpinner.vue";

export default {
title: "LoadingSpinner",
excludeStories: /.*Data$/,
};

const template = `<loading-spinner :label="label"/>`;

export const Default = () => ({
components: { LoadingSpinner },
template: template,
data: () => ({
label: null,
}),
});

export const Label = () => ({
components: { LoadingSpinner },
template: template,
data: () => ({
label: "Loading...",
}),
});
23 changes: 23 additions & 0 deletions ui/src/components/LoadingSpinner.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<template>
<div class="d-flex flex-column justify-center align-center pa-4 h-100">
<v-progress-circular :size="size" color="primary" indeterminate />
<p v-if="label" class="subtitle-1 text-medium-emphasis mt-4">{{ label }}</p>
</div>
</template>
<script>
export default {
name: "LoadingSpinner",
props: {
label: {
type: String,
required: false,
default: null,
},
size: {
type: [String, Number],
required: false,
default: 48,
},
},
};
</script>

0 comments on commit b83dc3c

Please sign in to comment.