Skip to content

Commit d37f7f0

Browse files
committed
Add icons for table buttons
1 parent 16f59c0 commit d37f7f0

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/lib/components/Table/TableContent.svelte

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script lang="ts">
2-
import { createEventDispatcher, onMount } from 'svelte';
2+
import { createEventDispatcher } from 'svelte';
33
import { readable, writable } from 'svelte/store';
44
55
import Fa from 'svelte-fa';
6-
import { faXmark } from '@fortawesome/free-solid-svg-icons';
6+
import { faCompress, faDownload, faXmark } from '@fortawesome/free-solid-svg-icons';
77
import { createTable, Subscribe, Render, createRender } from 'svelte-headless-table';
88
import {
99
addSortBy,
@@ -543,7 +543,8 @@
543543
{/if}
544544

545545
<div
546-
class="flex justify-between items-center w-full {search && 'py-2'} {!search &&
546+
class="flex justify-between overflow-x-auto items-center w-full {search &&
547+
'py-2'} {!search &&
547548
(shownColumns.length > 0 || toggle || resizable !== 'none' || exportable) &&
548549
'pb-2'}"
549550
>
@@ -569,20 +570,20 @@
569570
{#if resizable !== 'none'}
570571
<button
571572
type="button"
572-
class="btn btn-sm variant-filled-primary rounded-full order-last"
573+
class="btn btn-sm variant-filled-primary rounded-full order-last flex gap-2 items-center"
573574
aria-label="Reset sizing of columns and rows"
574575
on:click|preventDefault={() =>
575576
resetResize($headerRows, $pageRows, tableId, columns, resizable)}
576-
>Reset sizing</button
577+
><Fa icon={faCompress} /> Reset sizing</button
577578
>
578579
{/if}
579580
{#if exportable}
580581
<button
581582
type="button"
582-
class="btn btn-sm variant-filled-primary rounded-full order-last"
583+
class="btn btn-sm variant-filled-primary rounded-full order-last flex items-center gap-2"
583584
aria-label="Export table data as CSV"
584585
on:click|preventDefault={() => exportAsCsv(tableId, jsonToCsv($exportedData))}
585-
>Export as CSV</button
586+
><Fa icon={faDownload} /> Export as CSV</button
586587
>
587588
{/if}
588589
{#if shownColumns.length > 0}

0 commit comments

Comments
 (0)