mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +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
32 lines
581 B
Svelte
32 lines
581 B
Svelte
<script lang="ts">
|
|
import { RecursiveList } from "../types";
|
|
|
|
const children = [
|
|
{
|
|
text: "Item 1",
|
|
children: [
|
|
{
|
|
text: "Item 1a",
|
|
children: [{ html: "<h5>HTML content</h5>" }],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
text: "Item 2",
|
|
children: [
|
|
{
|
|
href: "https://svelte.dev/",
|
|
},
|
|
{
|
|
href: "https://svelte.dev/",
|
|
text: "Link with custom text",
|
|
},
|
|
],
|
|
},
|
|
{
|
|
text: "Item 3",
|
|
},
|
|
];
|
|
</script>
|
|
|
|
<RecursiveList type="ordered" children="{children}" />
|