Skip to content

Commit 1abbf1e

Browse files
committed
Redesign table
1 parent 6374fbf commit 1abbf1e

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

.changeset/polite-cameras-cough.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"streamdown": patch
3+
---
4+
5+
Redesign table

packages/streamdown/lib/components.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ type TbodyProps = WithNode<JSX.IntrinsicElements["tbody"]>;
442442
const MemoTbody = memo<TbodyProps>(
443443
({ children, className, node, ...props }: TbodyProps) => (
444444
<tbody
445-
className={cn("divide-y divide-border bg-muted/40", className)}
445+
className={cn("divide-y divide-border", className)}
446446
data-streamdown="table-body"
447447
{...props}
448448
>
@@ -457,7 +457,7 @@ type TrProps = WithNode<JSX.IntrinsicElements["tr"]>;
457457
const MemoTr = memo<TrProps>(
458458
({ children, className, node, ...props }: TrProps) => (
459459
<tr
460-
className={cn("border-border border-b", className)}
460+
className={cn("border-border", className)}
461461
data-streamdown="table-row"
462462
{...props}
463463
>

packages/streamdown/lib/table/index.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,19 @@ export const Table = ({
1313
showControls,
1414
...props
1515
}: TableProps) => (
16-
<div className="my-4 flex flex-col space-y-2" data-streamdown="table-wrapper">
16+
<div
17+
className="my-4 flex flex-col gap-2 rounded-md border border-border bg-sidebar p-2"
18+
data-streamdown="table-wrapper"
19+
>
1720
{showControls ? (
1821
<div className="flex items-center justify-end gap-1">
1922
<TableCopyDropdown />
2023
<TableDownloadDropdown />
2124
</div>
2225
) : null}
23-
<div className="overflow-x-auto overscroll-y-auto">
26+
<div className="border-collapse overflow-x-auto overscroll-y-auto rounded-sm border border-border bg-background">
2427
<table
25-
className={cn("w-full border-collapse border border-border", className)}
28+
className={cn("w-full divide-y divide-border", className)}
2629
data-streamdown="table"
2730
{...props}
2831
>

0 commit comments

Comments
 (0)