diff --git a/docs/app/components/content/examples/tabs/TabsContentSlotExample.vue b/docs/app/components/content/examples/tabs/TabsContentSlotExample.vue new file mode 100644 index 00000000..3f25fe32 --- /dev/null +++ b/docs/app/components/content/examples/tabs/TabsContentSlotExample.vue @@ -0,0 +1,20 @@ + + + + + + This is the {{ item.label }} tab. + + + diff --git a/docs/app/components/content/examples/tabs/TabsCustomSlotExample.vue b/docs/app/components/content/examples/tabs/TabsCustomSlotExample.vue new file mode 100644 index 00000000..158fe5d7 --- /dev/null +++ b/docs/app/components/content/examples/tabs/TabsCustomSlotExample.vue @@ -0,0 +1,65 @@ + + + + + + + {{ item.description }} + + + + + + + + + + + + + + + + + {{ item.description }} + + + + + + + + + + + + + + + + + + diff --git a/docs/app/components/content/examples/tabs/TabsModelValueExample.vue b/docs/app/components/content/examples/tabs/TabsModelValueExample.vue new file mode 100644 index 00000000..bce59b25 --- /dev/null +++ b/docs/app/components/content/examples/tabs/TabsModelValueExample.vue @@ -0,0 +1,16 @@ + + + + + diff --git a/docs/content/3.components/tabs.md b/docs/content/3.components/tabs.md index 4db0dc40..92385f8c 100644 --- a/docs/content/3.components/tabs.md +++ b/docs/content/3.components/tabs.md @@ -30,15 +30,12 @@ hide: props: class: 'w-full' items: - - label: Tab 1 - icon: 'i-heroicons-academic-cap' - content: 'Content 1' - - label: Tab 2 + - label: Account icon: 'i-heroicons-user' - content: 'Content 2' - - label: Tab 3 - icon: 'i-heroicons-bell' - content: 'Content 3' + content: 'This is the account content.' + - label: Password + icon: 'i-heroicons-lock-closed' + content: 'This is the password content.' --- :: @@ -65,9 +62,8 @@ props: class: 'w-full' content: false items: - - label: Tab 1 - - label: Tab 2 - - label: Tab 3 + - label: Account + - label: Password --- :: @@ -86,12 +82,12 @@ hide: - class props: size: md + variant: pill class: 'w-full' content: false items: - - label: Tab 1 - - label: Tab 2 - - label: Tab 3 + - label: Account + - label: Password --- :: @@ -114,14 +110,73 @@ props: class: 'w-full' content: false items: - - label: Tab 1 - - label: Tab 2 - - label: Tab 3 + - label: Account + - label: Password +--- +:: + +### Default value + +Use the `default-value` prop to set the default value of the Tabs with the index of the item. You can also pass the value of one of the items if provided. + +::component-code +--- +ignore: + - items + - content + - defaultValue +external: + - items +hide: + - class +props: + defaultValue: '1' + class: 'w-full' + content: false + items: + - label: Account + - label: Password +--- +:: + +### Model value + +You can control the selected tab by using the `v-model` directive. + +::component-example +--- +name: 'tabs-model-value-example' +props: + class: 'w-full' --- :: ## Examples +### With content slot + +Use the `#content` slot to customize each item. + +::component-example +--- +name: 'tabs-content-slot-example' +props: + class: 'w-full' +--- +:: + +### With custom slot + +Use the `slot` property to customize a specific item with a form for example. + +::component-example +--- +name: 'tabs-custom-slot-example' +props: + class: 'w-full' +--- +:: + ## API ### Props
This is the {{ item.label }} tab.
+ {{ item.description }} +