prepate progress.md
This commit is contained in:
15
docs/components/progress/examples/ProgressColorExample.vue
Normal file
15
docs/components/progress/examples/ProgressColorExample.vue
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<template>
|
||||||
|
<div class="vp-raw flex flex-col grid gap-4">
|
||||||
|
<Progress label="Default" progress="45"></Progress>
|
||||||
|
<Progress color="dark" label="Dark" progress="45"></Progress>
|
||||||
|
<Progress color="blue" label="Blue" progress="45"></Progress>
|
||||||
|
<Progress color="red" label="Red" progress="45"></Progress>
|
||||||
|
<Progress color="green" label="Green" progress="45"></Progress>
|
||||||
|
<Progress color="yellow" label="Yellow" progress="45"></Progress>
|
||||||
|
<Progress color="indigo" label="Indigo" progress="45"></Progress>
|
||||||
|
<Progress color="purple" label="Purple" progress="45"></Progress>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { Progress } from '../../../../src/index'
|
||||||
|
</script>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="vp-raw flex flex-col">
|
<div class="vp-raw flex flex-col">
|
||||||
<Progress></Progress>
|
<Progress progress="45"></Progress>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<template>
|
||||||
|
<Progress labelProgress="true" labelPosition="inside" progress="45"></Progress>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { Progress } from '../../../../src/index'
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<template>
|
||||||
|
<Progress labelProgress="true" labelPosition="outside" label="Flowbite Vue 3" progress="45"></Progress>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { Progress } from '../../../../src/index'
|
||||||
|
</script>
|
||||||
11
docs/components/progress/examples/ProgressSizeExample.vue
Normal file
11
docs/components/progress/examples/ProgressSizeExample.vue
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<template>
|
||||||
|
<div class="flex flex-col grid gap-4">
|
||||||
|
<Progress size="sm" label="Small" progress="45"></Progress>
|
||||||
|
<Progress size="md" label="Medium" progress="45"></Progress>
|
||||||
|
<Progress size="lg" label="Large" progress="45"></Progress>
|
||||||
|
<Progress size="xl" label="Extra Large" progress="45"></Progress>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { Progress } from '../../../../src/index'
|
||||||
|
</script>
|
||||||
@@ -1,14 +1,22 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import ProgressExample from './examples/ProgressExample.vue'
|
import ProgressExample from './examples/ProgressExample.vue'
|
||||||
|
import ProgressSizeExample from './examples/ProgressSizeExample.vue'
|
||||||
|
import ProgressInsideLabelExample from './examples/ProgressInsideLabelExample.vue'
|
||||||
|
import ProgressOutsideLabelExample from './examples/ProgressOutsideLabelExample.vue'
|
||||||
|
import ProgressColorExample from './examples/ProgressColorExample.vue'
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
# Vue Progress Bar Component - Flowbite
|
# Vue Progress Bar Component - Flowbite
|
||||||
|
|
||||||
|
## Default
|
||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script setup>
|
<script setup>
|
||||||
import { Progress } from 'flowbite-vue'
|
import { Progress } from 'flowbite-vue'
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<Progress></Progress>
|
<Progress progress="45"></Progress>
|
||||||
</template>
|
</template>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -17,11 +25,78 @@ import { Progress } from 'flowbite-vue'
|
|||||||
## Sizes
|
## Sizes
|
||||||
You can also use different sizes by using various sizing.
|
You can also use different sizes by using various sizing.
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<script setup>
|
||||||
|
import { Progress } from 'flowbite-vue'
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<!-- small size -->
|
||||||
|
<Progress size="sm" label="Small" progress="45"></Progress>
|
||||||
|
<!-- medium size -->
|
||||||
|
<Progress size="md" label="Medium" progress="45"></Progress>
|
||||||
|
<!-- large size -->
|
||||||
|
<Progress size="lg" label="Large" progress="45"></Progress>
|
||||||
|
<!-- extra large size -->
|
||||||
|
<Progress size="xl" label="Extra Large" progress="45"></Progress>
|
||||||
|
</template>
|
||||||
|
```
|
||||||
|
|
||||||
|
<ProgressSizeExample />
|
||||||
|
|
||||||
## With label inside
|
## With label inside
|
||||||
Here is an example of using a progress bar with the label inside the bar.
|
Here is an example of using a progress bar with the label inside the bar.
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<script setup>
|
||||||
|
import { Progress } from 'flowbite-vue'
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<Progress labelProgress="true" labelPosition="inside" progress="45"></Progress>
|
||||||
|
</template>
|
||||||
|
```
|
||||||
|
|
||||||
|
<ProgressInsideLabelExample />
|
||||||
|
|
||||||
## With label outside
|
## With label outside
|
||||||
And this is an example of using a progress bar outside the bar.
|
And this is an example of using a progress bar outside the bar.
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<script setup>
|
||||||
|
import { Progress } from 'flowbite-vue'
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<Progress labelProgress="true" labelPosition="outside" label="Flowbite Vue 3" progress="45"></Progress>
|
||||||
|
</template>
|
||||||
|
```
|
||||||
|
|
||||||
|
<ProgressOutsideLabelExample />
|
||||||
|
|
||||||
## Colors
|
## Colors
|
||||||
You can also apply color.
|
You can also apply color.
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<script setup>
|
||||||
|
import { Progress } from 'flowbite-vue'
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<!-- Default color -->
|
||||||
|
<Progress label="Default" progress="45"></Progress>
|
||||||
|
<!-- Dark -->
|
||||||
|
<Progress color="dark" label="Dark" progress="45"></Progress>
|
||||||
|
<!-- Blue -->
|
||||||
|
<Progress color="blue" label="Blue" progress="45"></Progress>
|
||||||
|
<!-- Red -->
|
||||||
|
<Progress color="red" label="Red" progress="45"></Progress>
|
||||||
|
<!-- Green -->
|
||||||
|
<Progress color="green" label="Green" progress="45"></Progress>
|
||||||
|
<!-- Yellow -->
|
||||||
|
<Progress color="yellow" label="Yellow" progress="45"></Progress>
|
||||||
|
<!-- Indigo -->
|
||||||
|
<Progress color="indigo" label="Indigo" progress="45"></Progress>
|
||||||
|
<!-- Purple -->
|
||||||
|
<Progress color="purple" label="Purple" progress="45"></Progress>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
```
|
||||||
|
|
||||||
|
<ProgressColorExample />
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
<template v-if="label || (labelProgress && labelPosition === 'outside')">
|
<template v-if="label || (labelProgress && labelPosition === 'outside')">
|
||||||
<div class="flex justify-between mb-1">
|
<div class="flex justify-between mb-1">
|
||||||
<span v-show="label || (labelProgress && labelPosition === 'outside')" class="text-base font-medium" :class="outsideLabelClasses">{{ label }}</span>
|
<span v-show="label || (labelProgress && labelPosition === 'outside')" class="text-base font-medium" :class="outsideLabelClasses">{{ label }}</span>
|
||||||
@@ -12,6 +13,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, toRefs } from 'vue'
|
import { computed, toRefs } from 'vue'
|
||||||
@@ -20,8 +22,8 @@ import { useProgressClasses } from './composables/useProgressClasses'
|
|||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
color: {
|
color: {
|
||||||
type: String, // 'dark' | 'blue' | 'red' | 'green' | 'yellow' | 'indigo' | 'purple'
|
type: String, // 'default' | 'dark' | 'blue' | 'red' | 'green' | 'yellow' | 'indigo' | 'purple'
|
||||||
default: 'pink',
|
default: 'default',
|
||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -33,11 +35,11 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
labelProgress: {
|
labelProgress: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: false,
|
||||||
},
|
},
|
||||||
progress: {
|
progress: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 45,
|
default: 0,
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
type: String, // 'sm' | 'md' | 'lg' | 'xl'
|
type: String, // 'sm' | 'md' | 'lg' | 'xl'
|
||||||
|
|||||||
@@ -11,28 +11,24 @@ const barColorClasses: Record<ProgressVariant, string> = {
|
|||||||
// default: {
|
// default: {
|
||||||
default: 'bg-blue-600 dark:bg-blue-600',
|
default: 'bg-blue-600 dark:bg-blue-600',
|
||||||
blue: 'bg-blue-600 dark:bg-blue-600',
|
blue: 'bg-blue-600 dark:bg-blue-600',
|
||||||
alternative: 'dark:bg-gray-800',
|
|
||||||
dark: 'bg-gray-600 dark:bg-gray-300',
|
dark: 'bg-gray-600 dark:bg-gray-300',
|
||||||
light: 'bg-white dark:bg-gray-800',
|
|
||||||
green: 'bg-green-600 dark:bg-green-500',
|
green: 'bg-green-600 dark:bg-green-500',
|
||||||
red: 'bg-red-600 dark:bg-red-500',
|
red: 'bg-red-600 dark:bg-red-500',
|
||||||
yellow: 'bg-yellow-400',
|
yellow: 'bg-yellow-400',
|
||||||
|
indigo: 'bg-indigo-600 dark:bg-indigo-500',
|
||||||
purple: 'bg-purple-600 dark:bg-purple-500',
|
purple: 'bg-purple-600 dark:bg-purple-500',
|
||||||
pink: 'bg-pink-700 dark:bg-pink-600',
|
|
||||||
// },
|
// },
|
||||||
}
|
}
|
||||||
|
|
||||||
const outsideTextColorClasses: Record<ProgressVariant, string> = {
|
const outsideTextColorClasses: Record<ProgressVariant, string> = {
|
||||||
default: 'text-blue-700 dark:text-blue-500',
|
default: '',
|
||||||
blue: 'text-blue-700 dark:text-blue-500',
|
blue: 'text-blue-700 dark:text-blue-500',
|
||||||
alternative: 'dark:bg-gray-800',
|
|
||||||
dark: 'dark:text-white',
|
dark: 'dark:text-white',
|
||||||
light: 'text-white dark:text-gray-800',
|
|
||||||
green: 'text-green-700 dark:text-green-500',
|
green: 'text-green-700 dark:text-green-500',
|
||||||
red: 'text-red-700 dark:text-red-500',
|
red: 'text-red-700 dark:text-red-500',
|
||||||
yellow: 'text-yellow-700 dark:text-yellow-500',
|
yellow: 'text-yellow-700 dark:text-yellow-500',
|
||||||
|
indigo: 'text-indigo-700 dark:text-indigo-500',
|
||||||
purple: 'text-purple-700 dark:text-purple-500',
|
purple: 'text-purple-700 dark:text-purple-500',
|
||||||
pink: 'text-pink-700 dark:text-pink-600',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const progressSizeClasses: Record<ProgressSize, string> = {
|
const progressSizeClasses: Record<ProgressSize, string> = {
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
export type progressColor = 'default' | 'alternative' | 'dark' | 'light' | 'green' | 'red' | 'yellow' | 'purple' | 'pink' | 'blue'
|
export type ProgressVariant = 'default' | 'dark' | 'green' | 'red' | 'yellow' | 'purple' | 'blue' | 'indigo'
|
||||||
export type ProgressVariant = 'default' | 'alternative' | 'dark' | 'light' | 'green' | 'red' | 'yellow' | 'purple' | 'pink' | 'blue'
|
|
||||||
export type ProgressSize = 'sm' | 'md' | 'lg' | 'xl'
|
export type ProgressSize = 'sm' | 'md' | 'lg' | 'xl'
|
||||||
Reference in New Issue
Block a user