Skip to content

Commit d0441f5

Browse files
committedJul 29, 2024·
update sl-select suffix example
1 parent ad608d6 commit d0441f5

File tree

1 file changed

+5
-29
lines changed

1 file changed

+5
-29
lines changed
 

‎docs/pages/components/select.md

+5-29
Original file line numberDiff line numberDiff line change
@@ -395,54 +395,30 @@ const App = () => (
395395
);
396396
```
397397

398-
### Prefix Icons
398+
### Prefix & Suffix
399399

400-
Use the `prefix` slot to prepend an icon to the control.
400+
Use the `prefix` and `suffix` slots to add presentational icons and text. Avoid slotting in interactive elements, such as buttons, links, etc.
401401

402402
```html:preview
403403
<sl-select placeholder="Small" size="small" clearable>
404404
<sl-icon name="house" slot="prefix"></sl-icon>
405+
<sl-badge slot="suffix">New</sl-badge>
405406
<sl-option value="option-1">Option 1</sl-option>
406407
<sl-option value="option-2">Option 2</sl-option>
407408
<sl-option value="option-3">Option 3</sl-option>
408409
</sl-select>
409410
<br />
410411
<sl-select placeholder="Medium" size="medium" clearable>
411412
<sl-icon name="house" slot="prefix"></sl-icon>
413+
<sl-badge slot="suffix">New</sl-badge>
412414
<sl-option value="option-1">Option 1</sl-option>
413415
<sl-option value="option-2">Option 2</sl-option>
414416
<sl-option value="option-3">Option 3</sl-option>
415417
</sl-select>
416418
<br />
417419
<sl-select placeholder="Large" size="large" clearable>
418420
<sl-icon name="house" slot="prefix"></sl-icon>
419-
<sl-option value="option-1">Option 1</sl-option>
420-
<sl-option value="option-2">Option 2</sl-option>
421-
<sl-option value="option-3">Option 3</sl-option>
422-
</sl-select>
423-
```
424-
425-
### Suffix Icons
426-
427-
Use the `suffix` slot to append an icon to the control.
428-
429-
```html:preview
430-
<sl-select placeholder="Small" size="small" clearable>
431-
<sl-icon name="house" slot="suffix"></sl-icon>
432-
<sl-option value="option-1">Option 1</sl-option>
433-
<sl-option value="option-2">Option 2</sl-option>
434-
<sl-option value="option-3">Option 3</sl-option>
435-
</sl-select>
436-
<br />
437-
<sl-select placeholder="Medium" size="medium" clearable>
438-
<sl-icon name="house" slot="suffix"></sl-icon>
439-
<sl-option value="option-1">Option 1</sl-option>
440-
<sl-option value="option-2">Option 2</sl-option>
441-
<sl-option value="option-3">Option 3</sl-option>
442-
</sl-select>
443-
<br />
444-
<sl-select placeholder="Large" size="large" clearable>
445-
<sl-icon name="house" slot="suffix"></sl-icon>
421+
<sl-badge slot="suffix">New</sl-badge>
446422
<sl-option value="option-1">Option 1</sl-option>
447423
<sl-option value="option-2">Option 2</sl-option>
448424
<sl-option value="option-3">Option 3</sl-option>

0 commit comments

Comments
 (0)