docs(tabs): update

This commit is contained in:
Benjamin Canac
2024-08-06 12:41:47 +02:00
parent 8da6a1c0e2
commit 279f55ee2c
4 changed files with 20 additions and 45 deletions

View File

@@ -12,7 +12,7 @@ const items = [
</script> </script>
<template> <template>
<UTabs :items="items"> <UTabs :items="items" class="w-full">
<template #content="{ item }"> <template #content="{ item }">
<p>This is the {{ item.label }} tab.</p> <p>This is the {{ item.label }} tab.</p>
</template> </template>

View File

@@ -24,7 +24,7 @@ const state = reactive({
</script> </script>
<template> <template>
<UTabs :items="items" variant="link" class="gap-4" :ui="{ trigger: 'flex-1' }"> <UTabs :items="items" variant="link" class="gap-4 w-full" :ui="{ trigger: 'flex-1' }">
<template #account="{ item }"> <template #account="{ item }">
<p class="text-gray-500 dark:text-gray-400 mb-4"> <p class="text-gray-500 dark:text-gray-400 mb-4">
{{ item.description }} {{ item.description }}

View File

@@ -19,5 +19,5 @@ onMounted(() => {
</script> </script>
<template> <template>
<UTabs v-model="active" :content="false" :items="items" /> <UTabs v-model="active" :content="false" :items="items" class="w-full" />
</template> </template>

View File

@@ -25,12 +25,10 @@ Use the `items` prop as an array of objects with the following properties:
--- ---
ignore: ignore:
- items - items
- class
external: external:
- items - items
hide:
- class
props: props:
class: 'w-full'
items: items:
- label: Account - label: Account
icon: 'i-heroicons-user' icon: 'i-heroicons-user'
@@ -38,6 +36,7 @@ props:
- label: Password - label: Password
icon: 'i-heroicons-lock-closed' icon: 'i-heroicons-lock-closed'
content: 'This is the password content.' content: 'This is the password content.'
class: 'w-full'
--- ---
:: ::
@@ -52,12 +51,10 @@ You can set it to `false` to prevent the Tabs from rendering any content and act
ignore: ignore:
- content - content
- items - items
- class
external: external:
- items - items
hide:
- class
props: props:
class: 'w-full'
content: false content: false
items: items:
- label: Account - label: Account
@@ -66,6 +63,7 @@ props:
- label: Password - label: Password
icon: 'i-heroicons-lock-closed' icon: 'i-heroicons-lock-closed'
content: 'This is the password content.' content: 'This is the password content.'
class: 'w-full'
--- ---
:: ::
@@ -77,12 +75,10 @@ prettier: true
ignore: ignore:
- content.forceMount - content.forceMount
- items - items
- class
external: external:
- items - items
hide:
- class
props: props:
class: 'w-full'
content: content:
forceMount: false forceMount: false
items: items:
@@ -92,6 +88,7 @@ props:
- label: Password - label: Password
icon: 'i-heroicons-lock-closed' icon: 'i-heroicons-lock-closed'
content: 'This is the password content.' content: 'This is the password content.'
class: 'w-full'
--- ---
:: ::
@@ -108,17 +105,16 @@ Use the `color` prop to change the color of the Tabs.
ignore: ignore:
- content - content
- items - items
- class
external: external:
- items - items
hide:
- class
props: props:
color: gray color: gray
class: 'w-full'
content: false content: false
items: items:
- label: Account - label: Account
- label: Password - label: Password
class: 'w-full'
--- ---
:: ::
@@ -131,18 +127,17 @@ Use the `variant` prop to change the variant of the Tabs.
ignore: ignore:
- content - content
- items - items
- class
external: external:
- items - items
hide:
- class
props: props:
color: gray color: gray
variant: link variant: link
class: 'w-full'
content: false content: false
items: items:
- label: Account - label: Account
- label: Password - label: Password
class: 'w-full'
--- ---
:: ::
@@ -155,18 +150,17 @@ Use the `size` prop to change the size of the Tabs.
ignore: ignore:
- content - content
- items - items
- class
external: external:
- items - items
hide:
- class
props: props:
size: md size: md
variant: pill variant: pill
class: 'w-full'
content: false content: false
items: items:
- label: Account - label: Account
- label: Password - label: Password
class: 'w-full'
--- ---
:: ::
@@ -179,18 +173,17 @@ Use the `orientation` prop to change the orientation of the Tabs. Defaults to `h
ignore: ignore:
- content - content
- items - items
- class
external: external:
- items - items
hide:
- class
props: props:
orientation: vertical orientation: vertical
variant: pill variant: pill
class: 'w-full'
content: false content: false
items: items:
- label: Account - label: Account
- label: Password - label: Password
class: 'w-full'
--- ---
:: ::
@@ -200,13 +193,7 @@ props:
You can control the active tab by using the `default-value` prop or the `v-model` directive with the index of the item. You can control the active tab by using the `default-value` prop or the `v-model` directive with the index of the item.
::component-example :component-example{name="tabs-model-value-example"}
---
name: 'tabs-model-value-example'
props:
class: 'w-full'
---
::
::tip ::tip
You can also pass the `value` of one of the items if provided. You can also pass the `value` of one of the items if provided.
@@ -216,25 +203,13 @@ You can also pass the `value` of one of the items if provided.
Use the `#content` slot to customize the content of each item. Use the `#content` slot to customize the content of each item.
::component-example :component-example{name="tabs-content-slot-example"}
---
name: 'tabs-content-slot-example'
props:
class: 'w-full'
---
::
### With custom slot ### With custom slot
Use the `slot` property to customize a specific item. Use the `slot` property to customize a specific item.
::component-example :component-example{name="tabs-custom-slot-example"}
---
name: 'tabs-custom-slot-example'
props:
class: 'w-full'
---
::
## API ## API