CoolFace
Datasetpublic

gradio/frontend

sourceHugging Faceupdated 13h agoView on Hugging Face
1likes442kdownloads
Example.svelte42 linesDownload Raw Back to fileexplorer
1<script lang="ts">2	export let value: string[] | string | null;3	export let type: "gallery" | "table";4	export let selected = false;5</script>6 7<ul8	class:table={type === "table"}9	class:gallery={type === "gallery"}10	class:selected11>12	{#if value}13		{#each Array.isArray(value) ? value.slice(0, 3) : [value] as path}14			<li><code>./{path}</code></li>15		{/each}16		{#if Array.isArray(value) && value.length > 3}17			<li class="extra">...</li>18		{/if}19	{/if}20</ul>21 22<style>23	ul {24		white-space: nowrap;25		max-height: 100px;26		list-style: none;27		padding: 0;28		margin: 0;29	}30 31	.extra {32		text-align: center;33	}34 35	.gallery {36		align-items: center;37		cursor: pointer;38		padding: var(--size-1) var(--size-2);39		text-align: left;40	}41</style>42 
gradio/frontend · CoolFace