mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-19 03:49:34 +00:00
* feat(recursive-list): add RecursiveList * feat(recursive-list): rename items prop to children * docs(recursive-list): add full examples * test(recursive-list): add types test * refactor(recursive-list): remove superfluous nested prop * docs(recursive-list): update docs * fix(recursive-list): remove nested prop from type test * fix(recursive-list): explicitly type restProps
19 lines
442 B
Svelte
19 lines
442 B
Svelte
<script>
|
|
/** Specify the text to render*/
|
|
export let text = "";
|
|
|
|
/** Specify a link href */
|
|
export let href = "";
|
|
|
|
/** Specify HTML to render using `@html` */
|
|
export let html = "";
|
|
|
|
import ListItem from "../ListItem/ListItem.svelte";
|
|
</script>
|
|
|
|
<ListItem>
|
|
{#if text && !href}{text}{/if}
|
|
{#if href}<a class:bx--link="{true}" href="{href}">{text || href}</a>{/if}
|
|
{#if !text && html}{@html html}{/if}
|
|
<slot />
|
|
</ListItem>
|