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])
-
+
{{ selected }}
-
+
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([])
-
-
- {{ selected.join(', ') }}
- Select people
-
-
+
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 @@
+
+
+
+
+
+ {{ selected.join(', ') }}
+ Select people
+
+
+
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([])
- {{ selected.join(', ') }}
- Select people
+ {{ selected.join(', ') }}
+ Select people
```
::
-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
-
+
{{ selected }}
@@ -81,6 +107,8 @@ const selected = ref(people[3])
```
::
+### Objects
+
You can pass an array of objects to `options` and either compare on the whole object or use the `by` prop to compare on a specific key. You can configure which field will be used to display the label through the `option-attribute` prop that defaults to `label`.
::component-example
diff --git a/src/runtime/app.config.ts b/src/runtime/app.config.ts
index 112d5041..81053b68 100644
--- a/src/runtime/app.config.ts
+++ b/src/runtime/app.config.ts
@@ -345,6 +345,7 @@ const textarea = {
const select = {
...input,
+ placeholder: 'text-gray-900 dark:text-white',
default: {
size: 'sm',
color: 'white',
diff --git a/src/runtime/components/forms/Select.vue b/src/runtime/components/forms/Select.vue
index 6f64c780..b4eb9688 100644
--- a/src/runtime/components/forms/Select.vue
+++ b/src/runtime/components/forms/Select.vue
@@ -207,7 +207,6 @@ export default defineComponent({
return classNames(
ui.value.base,
ui.value.rounded,
- ui.value.placeholder,
ui.value.size[props.size],
props.padded && ui.value.padding[props.size],
variant?.replaceAll('{color}', props.color),
diff --git a/src/runtime/components/forms/SelectMenu.vue b/src/runtime/components/forms/SelectMenu.vue
index 6bab6e0d..a683801a 100644
--- a/src/runtime/components/forms/SelectMenu.vue
+++ b/src/runtime/components/forms/SelectMenu.vue
@@ -34,8 +34,9 @@
- {{ typeof modelValue === 'string' ? modelValue : modelValue[optionAttribute] }}
- {{ placeholder || ' ' }}
+ {{ modelValue.length }} selected
+ {{ typeof modelValue === 'string' ? modelValue : modelValue[optionAttribute] }}
+ {{ placeholder || ' ' }}
@@ -268,7 +269,6 @@ export default defineComponent({
return classNames(
uiSelect.value.base,
uiSelect.value.rounded,
- uiSelect.value.placeholder,
'text-left cursor-default',
uiSelect.value.size[props.size],
uiSelect.value.gap[props.size],