diff --git a/docs/components/select.md b/docs/components/select.md index efe937b94..51f482e51 100644 --- a/docs/components/select.md +++ b/docs/components/select.md @@ -286,7 +286,36 @@ TODO ### Grouping Options -TODO +Use `` to group listbox items visually. You can also use `` to provide labels, but they won't be announced by most assistive devices. + +```html preview + + Section 1 + Option 1 + Option 2 + Option 3 + + Section 2 + Option 4 + Option 5 + Option 6 + +``` + +```jsx react +import { SlOption, SlSelect } from '@shoelace-style/shoelace/dist/react'; + +const App = () => ( + + Option 1 + Option 2 + Option 3 + Option 4 + Option 5 + Option 6 + +); +``` ### Sizes diff --git a/src/components/select/select.styles.ts b/src/components/select/select.styles.ts index 14f274551..4323eef78 100644 --- a/src/components/select/select.styles.ts +++ b/src/components/select/select.styles.ts @@ -244,7 +244,15 @@ export default css` max-height: var(--auto-size-available-height); } + /* Slotted content */ .select__listbox::slotted(sl-divider) { --spacing: var(--sl-spacing-x-small); } + + .select__listbox::slotted(small) { + font-size: var(--sl-font-size-small); + font-weight: var(--sl-font-weight-semibold); + color: var(--sl-color-neutral-500); + padding: var(--sl-spacing-x-small) var(--sl-spacing-x-large); + } `;