diff --git a/docs/components/content/examples/SelectMenuExampleButton.vue b/docs/components/content/examples/SelectMenuExampleButton.vue index 462efb16..bb43c9f2 100644 --- a/docs/components/content/examples/SelectMenuExampleButton.vue +++ b/docs/components/content/examples/SelectMenuExampleButton.vue @@ -6,10 +6,10 @@ const selected = ref(people[3]) diff --git a/docs/components/content/examples/SelectMenuExampleMultiple.vue b/docs/components/content/examples/SelectMenuExampleMultiple.vue index cb7d791a..ea68128c 100644 --- a/docs/components/content/examples/SelectMenuExampleMultiple.vue +++ b/docs/components/content/examples/SelectMenuExampleMultiple.vue @@ -5,10 +5,5 @@ const selected = ref([]) diff --git a/docs/components/content/examples/SelectMenuExampleMultipleSlot.vue b/docs/components/content/examples/SelectMenuExampleMultipleSlot.vue new file mode 100644 index 00000000..282dd831 --- /dev/null +++ b/docs/components/content/examples/SelectMenuExampleMultipleSlot.vue @@ -0,0 +1,14 @@ + + + diff --git a/docs/content/3.forms/4.select-menu.md b/docs/content/3.forms/4.select-menu.md index e2da7b5f..8cacdbd8 100644 --- a/docs/content/3.forms/4.select-menu.md +++ b/docs/content/3.forms/4.select-menu.md @@ -10,6 +10,8 @@ headlessui: The SelectMenu component renders by default a [Select](/forms/select) component and is based on the `ui.select` preset. You can use most of the Select props to configure the display if you don't want to override the default slot such as [color](/forms/select#style), [variant](/forms/select#style), [size](/forms/select#size), [placeholder](/forms/select#placeholder), [icon](/forms/select#icon), [disabled](/forms/select#disabled), etc. +### Options + Like the Select component, you can use the `options` prop to pass an array of strings or objects. ::component-example @@ -30,7 +32,9 @@ const selected = ref(people[0]) ``` :: -You can use the `multiple` prop to select multiple values but you have to override the `#label` slot and handle the display yourself. +### Multiple + +You can use the `multiple` prop to select multiple values. ::component-example #default @@ -39,7 +43,29 @@ You can use the `multiple` prop to select multiple values but you have to overri #code ```vue + + +``` +:: + +### Slots + +You can override the `#label` slot and handle the display yourself. + +::component-example +#default +:select-menu-example-multiple-slot{class="max-w-[12rem] w-full"} + +#code +```vue + @@ -47,15 +73,15 @@ const selected = ref([]) ``` :: -You can also override the default slot entirely. +You can also override the `#default` slot entirely. ::component-example #default @@ -64,14 +90,14 @@ You can also override the default slot entirely. #code ```vue