Skip to content

Commit bfc61f6

Browse files
committed
chore(overflow-menu): include @example for slot usage
1 parent e031ac2 commit bfc61f6

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed

COMPONENT_INDEX.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,17 +2708,17 @@ None.
27082708

27092709
### Props
27102710

2711-
| Prop name | Required | Kind | Reactive | Type | Default value | Description |
2712-
| :----------- | :------- | :--------------- | :------- | ------------------------------------------------------------------- | ------------------------------------------------ | ----------------------------------------------------------------- |
2713-
| ref | No | <code>let</code> | Yes | <code>null &#124; HTMLAnchorElement &#124; HTMLButtonElement</code> | <code>null</code> | Obtain a reference to the HTML element |
2714-
| primaryFocus | No | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` if the item should be focused when opening the menu |
2715-
| text | No | <code>let</code> | No | <code>string</code> | <code>"Provide text"</code> | Specify the item text.<br />Alternatively, use the default slot. |
2716-
| href | No | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the `href` attribute if the item is a link |
2717-
| disabled | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to disable the item |
2718-
| hasDivider | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to include a divider |
2719-
| danger | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to use the danger variant |
2720-
| requireTitle | No | <code>let</code> | No | <code>boolean</code> | <code>true</code> | Set to `false` to omit the button `title` attribute |
2721-
| id | No | <code>let</code> | No | <code>string</code> | <code>"ccs-" + Math.random().toString(36)</code> | Set an id for the top-level element |
2711+
| Prop name | Required | Kind | Reactive | Type | Default value | Description |
2712+
| :----------- | :------- | :--------------- | :------- | ------------------------------------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
2713+
| ref | No | <code>let</code> | Yes | <code>null &#124; HTMLAnchorElement &#124; HTMLButtonElement</code> | <code>null</code> | Obtain a reference to the HTML element |
2714+
| primaryFocus | No | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` if the item should be focused when opening the menu |
2715+
| text | No | <code>let</code> | No | <code>string</code> | <code>"Provide text"</code> | Specify the item text.<br />Alternatively, use the default slot.<br />@example <br />`svelte<br />&lt;OverflowMenuItem&gt;<br /> &lt;span&gt;Custom Text&lt;/span&gt;<br />&lt;/OverflowMenuItem&gt;<br />` |
2716+
| href | No | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the `href` attribute if the item is a link |
2717+
| disabled | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to disable the item |
2718+
| hasDivider | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to include a divider |
2719+
| danger | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to use the danger variant |
2720+
| requireTitle | No | <code>let</code> | No | <code>boolean</code> | <code>true</code> | Set to `false` to omit the button `title` attribute |
2721+
| id | No | <code>let</code> | No | <code>string</code> | <code>"ccs-" + Math.random().toString(36)</code> | Set an id for the top-level element |
27222722

27232723
### Slots
27242724

docs/src/COMPONENT_API.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10678,7 +10678,7 @@
1067810678
{
1067910679
"name": "text",
1068010680
"kind": "let",
10681-
"description": "Specify the item text.\nAlternatively, use the default slot.",
10681+
"description": "Specify the item text.\nAlternatively, use the default slot.\n@example \n```svelte\n<OverflowMenuItem>\n <span>Custom Text</span>\n</OverflowMenuItem>\n```",
1068210682
"type": "string",
1068310683
"value": "\"Provide text\"",
1068410684
"isFunction": false,

src/OverflowMenu/OverflowMenuItem.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
/**
77
* Specify the item text.
88
* Alternatively, use the default slot.
9+
* @example
10+
* ```svelte
11+
* <OverflowMenuItem>
12+
* <span>Custom Text</span>
13+
* </OverflowMenuItem>
14+
* ```
915
*/
1016
export let text = "Provide text";
1117

types/OverflowMenu/OverflowMenuItem.svelte.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ type $Props = {
77
/**
88
* Specify the item text.
99
* Alternatively, use the default slot.
10+
* @example
11+
* ```svelte
12+
* <OverflowMenuItem>
13+
* <span>Custom Text</span>
14+
* </OverflowMenuItem>
15+
* ```
1016
* @default "Provide text"
1117
*/
1218
text?: string;

0 commit comments

Comments
 (0)