diff --git a/docs/components/input.md b/docs/components/input.md index 4de41792..115e9624 100644 --- a/docs/components/input.md +++ b/docs/components/input.md @@ -84,18 +84,18 @@ Use the `prefix` and `suffix` slots to add icons. ```html preview - - + +
- - + +
- - + + ``` diff --git a/docs/components/select.md b/docs/components/select.md index 63376290..eb14d400 100644 --- a/docs/components/select.md +++ b/docs/components/select.md @@ -188,46 +188,34 @@ Add descriptive help text to a select with the `help-text` attribute. For help t ``` -### Prefix and Suffix +### Prefix & Suffix Icons -Use the `prefix` or `suffix` slot to add a prefix or suffix to the selected value +Use the `prefix` and `suffix` slots to add icons. ```html preview - - Name (Asc) - Name (Desc) - Value (Asc) - Value (Desc) - + + + Option 1 + Option 2 + Option 3 + -
- - - - 0.02 - 0.04 - 0.06 + + + Option 1 + Option 2 + Option 3 + + +
+ + + Option 1 + Option 2 + Option 3 + - - - - ``` [component-metadata:sl-select] diff --git a/docs/resources/changelog.md b/docs/resources/changelog.md index a404f5e0..bdfe90f2 100644 --- a/docs/resources/changelog.md +++ b/docs/resources/changelog.md @@ -39,6 +39,7 @@ This change applies to all design tokens that implement a color. Refer to the [c - Added `--sl-color-*-950` swatches to all color palettes - Added a console error that appears when menu items have duplicate values in `sl-select` - Added CodePen link to code examples +- Added `prefix` and `suffix` slots to `sl-select` [#501](https://github.com/shoelace-style/shoelace/pull/501) - Exposed base and dark stylesheets so they can be imported via JavaScript [#438](https://github.com/shoelace-style/shoelace/issues/438) - Fixed a bug in `sl-menu` where pressing Enter after using type to select would result in the wrong value - Fixed a bug in `sl-radio-group` where clicking a radio button would cause the wrong control to be focused diff --git a/src/components/select/select.ts b/src/components/select/select.ts index 70de2492..a639814a 100644 --- a/src/components/select/select.ts +++ b/src/components/select/select.ts @@ -32,7 +32,8 @@ let id = 0; * @dependency sl-tag * * @slot - The select's options in the form of menu items. - * @slot prefix - The select's prefix. + * @slot prefix - Used to prepend an icon or similar element to the select. + * @slot suffix - Used to append an icon or similar element to the select. * @slot label - The select's label. Alternatively, you can use the label prop. * @slot suffix - The select's suffix. * @slot help-text - Help text that describes how to use the select.