Skip to content

Commit 39302be

Browse files
committed
fixes
1 parent 2a1f3f7 commit 39302be

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

examples/ink-chat/src/app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ DESIGN PRINCIPLES:
107107
- TABLES: Always set explicit column widths so columns don't collapse. Use headerColor:"cyan". Keep column headers short (abbreviate if needed). Right-align numeric columns.
108108
- CHARTS: Use distinct colors per bar in BarChart. Good palette: cyan, green, yellow, magenta, blue, red. Use Sparkline for compact inline trends alongside other content.
109109
- COLOR STRATEGY: Use color with intention, not decoration. cyan for labels and headers. green for positive values, growth, success. red for negative values, decline, errors. yellow for warnings or neutral highlights. dimColor:true for secondary/supporting text. Avoid coloring everything — contrast comes from restraint.
110-
- BORDERS: Use borderStyle:"single" on Tables. Avoid unnecessary borders elsewhere — let the content breathe.
110+
- TABLES WITH SHADING: When using borderStyle on a Table, always set backgroundColor too (e.g. backgroundColor:"#1a1a1a") so the border characters share the same shading. This avoids visual gaps.
111111
- SPACING: Use gap:1 between sections. Don't over-pad. Keep the UI compact and scannable. NEVER add padding to the root element — the app already provides outer padding.
112112
- WIDTH: Target 80 columns. Set explicit widths on Tables (total columns should sum to ~70-75). Use wrap:"truncate-end" on Text in tight spaces.
113113
- CALLOUTS: Use Callout for key takeaways, important notes, tips, and warnings. Set type (info/tip/warning/important) for a colored left border accent. Keep content concise — one key point per Callout.

packages/ink/src/catalog.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,12 @@ export const standardComponentDefinitions = {
259259
borderStyle: z
260260
.enum(["single", "double", "round", "bold", "classic"])
261261
.nullable(),
262+
backgroundColor: z.string().nullable(),
262263
headerColor: z.string().nullable(),
263264
}),
264265
slots: [],
265266
description:
266-
"Tabular data display with headers and rows. Each row is a record mapping column keys to string values.",
267+
"Tabular data display with headers and rows. Each row is a record mapping column keys to string values. Set both borderStyle and backgroundColor together so borders share the same shading.",
267268
example: {
268269
columns: [
269270
{ header: "Name", key: "name", width: 20 },

packages/ink/src/components/standard.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ function TableComponent({ element }: ComponentRenderProps) {
325325
}>;
326326
rows?: Array<Record<string, string>>;
327327
borderStyle?: string;
328+
backgroundColor?: string;
328329
headerColor?: string;
329330
};
330331

@@ -363,7 +364,11 @@ function TableComponent({ element }: ComponentRenderProps) {
363364
| undefined;
364365

365366
return (
366-
<Box flexDirection="column" borderStyle={borderStyleProp}>
367+
<Box
368+
flexDirection="column"
369+
borderStyle={borderStyleProp}
370+
backgroundColor={p.backgroundColor}
371+
>
367372
{/* Header */}
368373
<Box>
369374
{columns.map((col, i) => (

0 commit comments

Comments
 (0)