CoolFace
Datasetpublic

gradio/frontend

sourceHugging Faceupdated 5h agoView on Hugging Face
1likes403kdownloads
Example.svelte33 linesDownload Raw Back to checkboxgroup
1<script lang="ts">2	export let value: string[];3	export let type: "gallery" | "table";4	export let selected = false;5	export let choices: [string, string | number][];6 7	let names = value8		.map(9			(val) =>10				(11					choices.find((pair) => pair[1] === val) as12						| [string, string | number]13						| undefined14				)?.[0]15		)16		.filter((name) => name !== undefined);17	let names_string = names.join(", ");18</script>19 20<div21	class:table={type === "table"}22	class:gallery={type === "gallery"}23	class:selected24>25	{names_string}26</div>27 28<style>29	.gallery {30		padding: var(--size-1) var(--size-2);31	}32</style>33 
gradio/frontend · CoolFace