docs: display button variants

This commit is contained in:
Eric Liu 2020-07-23 19:38:09 -07:00
commit 9aa01ce5fb
9 changed files with 184 additions and 24 deletions

View file

@ -1,23 +1,48 @@
<script context="module">
export function preload() {
return this.fetch("components.json")
.then(r => r.json())
.then(data => ({ data }));
.then((r) => r.json())
.then((data) => ({ data }));
}
</script>
<script>
export let data = [];
import { getContext, onMount } from "svelte";
import { UnorderedList, ListItem, Link } from "carbon-components-svelte";
const ctx = getContext("navigation");
let tail = undefined;
const unsubscribe = ctx.tail.subscribe((value) => {
tail = value;
});
onMount(() => {
if (tail) {
ctx.setTail(undefined);
}
return () => {
unsubscribe();
};
});
</script>
<style>
h1 {
margin-top: 0.5rem;
margin-bottom: 1rem;
}
</style>
<svelte:head>
<title>Components</title>
</svelte:head>
<h1>Components</h1>
<UnorderedList>
{#each data as data, i (data.title)}
<ListItem>