Horizontal board columns and cards
import * as React from "react";
import { ScrollView, View } from "react-native";
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
import { Avatar, Button, Glass, Icon, Text } from "@lumioui/ui";
import { BLOCK_STAGGER, Mount, World } from "../shared";
import { useHaptic } from "@lumioui/core";
export interface KanbanCard {
id: string;
title: string;
tag?: string;
tagColor?: string;
assignee?: string;
}
export interface KanbanColumn {
id: string;
title: string;
cards: KanbanCard[];
}
export interface KanbanBoardScreenProps {
board?: string;
columns?: KanbanColumn[];
onCardPress?: (id: string) => void;
onBack?: () => void;
}
const DEFAULT_COLUMNS: KanbanColumn[] = [
{
id: "todo",
title: "To do",
cards: [
{ id: "k1", title: "Empty state for search", tag: "Design", tagColor: "bg-[#65A30D]/15 text-[#65A30D]" },
{ id: "k2", title: "Token swap error copy", tag: "Copy", tagColor: "bg-warning/15 text-warning", assignee: "A" },
{ id: "k6", title: "Boarding-pass dark tint", tag: "Design", tagColor: "bg-[#65A30D]/15 text-[#65A30D]", assignee: "M" },
{ id: "k7", title: "Reminder haptics pass", tag: "Build", tagColor: "bg-success/15 text-success" },
{ id: "k8", title: "List-item density tokens", tag: "Spec", tagColor: "bg-chart-3/15 text-chart-3" },
],
},
{
id: "doing",
title: "In progress",
cards: [
{ id: "k3", title: "Seat-select screen", tag: "Build", tagColor: "bg-success/15 text-success", assignee: "B" },
{ id: "k4", title: "Dark-mode icon audit", assignee: "C" },
{ id: "k9", title: "Registry cache headers", tag: "Build", tagColor: "bg-success/15 text-success", assignee: "A" },
{ id: "k10", title: "Docs search empty state", tag: "Design", tagColor: "bg-[#65A30D]/15 text-[#65A30D]" },
],
},
{
id: "done",
title: "Done",
cards: [
{ id: "k5", title: "Onboarding accents", tag: "Design", tagColor: "bg-[#65A30D]/15 text-[#65A30D]" },
{ id: "k11", title: "Paywall plan cards", tag: "Build", tagColor: "bg-success/15 text-success", assignee: "B" },
{ id: "k12", title: "Icon set — travel batch", tag: "Spec", tagColor: "bg-chart-3/15 text-chart-3", assignee: "M" },
],
},
];
/** Kanban board — horizontal columns, cards with tags + assignee. */
export function KanbanBoardScreen({
board = "Mobile Q4",
columns = DEFAULT_COLUMNS,
onCardPress,
onBack,
}: KanbanBoardScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
return (
<World primary="#65A30D">
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top", "bottom"]}>
<View className="flex-row items-center gap-2 px-4 pb-1 pt-2">
<Button
variant="ghost"
size="icon"
haptic="light"
onPress={() => onBack?.()}
accessibilityLabel="Go back"
className="-ml-2 h-10 w-10"
>
<Icon name="chevron-left" size="md" color="foreground" />
</Button>
<Text variant="h2" accessibilityRole="header">
{board}
</Text>
{/* WIP tally — boards summarize load across lanes. */}
<Text variant="muted" className="text-xs">
{columns.reduce((s, c) => s + c.cards.length, 0)} cards · 2 in review
</Text>
</View>
{/* Columns scroll horizontally; cards stack vertically inside. */}
<ScrollView
horizontal
className="flex-1"
showsHorizontalScrollIndicator={false}
contentContainerStyle={{
paddingHorizontal: 12,
paddingBottom: insets.bottom + 24,
gap: 12,
flexGrow: 1,
}}
>
{columns.map((col, ci) => (
<Mount
key={col.id}
delay={BLOCK_STAGGER * ci}
className="w-[260px] self-stretch overflow-hidden rounded-2xl p-3"
>
<Glass interactive effect="regular" sheen={0.5} className="absolute inset-0 rounded-2xl" pointerEvents="none" />
<View className="flex-row items-center justify-between pb-2">
<Text className="text-sm font-semibold">{col.title}</Text>
<View className="rounded-full bg-muted px-2 py-0.5">
<Text className="text-xs text-muted-foreground">
{col.cards.length}
</Text>
</View>
</View>
<ScrollView
nestedScrollEnabled
showsVerticalScrollIndicator={false}
className="flex-1"
>
{col.cards.map((c) => (
<Button
key={c.id}
variant="ghost"
haptic="light"
onPress={() => onCardPress?.(c.id)}
accessibilityLabel={`Card ${c.title}`}
className="mb-2 w-full items-start overflow-hidden rounded-2xl bg-white p-3 shadow-sm dark:bg-[#1A1A20]"
>
<Text className="text-sm font-medium">{c.title}</Text>
<View className="flex-row items-center justify-between pt-2">
{c.tag && c.tagColor ? (
<View className={`rounded-full px-2 py-0.5 ${c.tagColor.split(" ")[0]}`}>
<Text className={`text-[10px] font-medium ${c.tagColor.split(" ")[1]}`}>
{c.tag}
</Text>
</View>
) : (
<View />
)}
{c.assignee && (
<Avatar size="sm" fallback={c.assignee} alt={c.assignee} className="h-6 w-6" />
)}
</View>
</Button>
))}
<Button
variant="ghost"
haptic="light"
onPress={() => haptics.light()}
accessibilityLabel={`Add card to ${col.title}`}
className="h-9 flex-row items-center gap-1.5 px-2"
>
<Icon name="plus" size="sm" color="mutedForeground" />
<Text className="text-xs text-muted-foreground">Add card</Text>
</Button>
</ScrollView>
</Mount>
))}
{/* Ghost end-column — the "new list" affordance every board app
carries at the tail. */}
<Button
variant="ghost"
haptic="light"
onPress={() => haptics.light()}
accessibilityLabel="Add a new list"
className="w-[260px] self-start items-start rounded-2xl border-2 border-dashed border-border bg-transparent p-4"
>
<View className="flex-row items-center gap-2">
<Icon name="plus" size="sm" color="mutedForeground" />
<Text className="text-sm font-medium text-muted-foreground">
New list
</Text>
</View>
</Button>
</ScrollView>
</SafeAreaView>
</World>
);
}
KanbanBoardScreen.displayName = "KanbanBoardScreen";
Recreate the "Kanban Board Screen" screen in React Native using LumioUI.
Goal: Horizontal board columns and cards Match the reference implementation's layout, behavior, and motion exactly — this is a production screen, not a mockup.
## Setup
Fastest path — install the screen plus its component deps:
```bash
npx lumioui add productivity-kanban-board
```
Or pull just the components: `npx lumioui add avatar button icon text`
Native packages:
- @lumioui/ui@latest
- @lumioui/core@latest
- react-native-safe-area-context@*
- react-native-reanimated@*
- react-native-svg@*
- nativewind@*
Stack assumptions: Expo SDK 54 / RN 0.81, Reanimated 4, NativeWind v4, TypeScript strict, Expo Go compatible.
## Components — how, where, when
### `avatar` — Circular user image with fallback initials and status dot.
- `<Avatar>` ×1
### `button` — Tactile pill button with press spring, ink wash and async loading.
- `<Button>` ×4
### `icon` — Lucide icon set mapped to theme colors and sizes.
- `<Icon>` ×3
### `text` — Themed type scale from caption to display.
- `<Text>` ×8
## Conventions (non-negotiable)
- Styling via NativeWind `className` with semantic tokens only: `bg-background`, `text-foreground`, `bg-card`, `text-card-foreground`, `bg-secondary`, `bg-muted`, `text-muted-foreground`, `bg-accent`, `bg-destructive`, `border-border`. Hard-coded colors only inside media overlays (`text-white`, `bg-black/N`).
- Motion via the token presets from `@lumioui/core` (`spring.press`, `spring.surface`, `spring.glide`, `timing.fast`, `timing.slow`, …) — no bespoke spring configs or durations.
- Gate transform motion behind `useReducedMotion()`; keep opacity/color feedback, drop travel and overshoot.
- Haptics via `useHaptic()`: `light` on press, `selection` on toggle/select, `warning` on invalid input. Never import expo-haptics directly.
- Press feedback via `usePressAnimation()` (~0.97 scale), not `activeOpacity` tricks.
- a11y: `accessibilityRole` + `accessibilityLabel` on every control, touch targets ≥44pt.
- Entrance choreography: staggered `Mount` wrappers (delay 0/60/120…) so regions land in sequence instead of popping in at once.
- Wrap the screen in `SafeAreaView`; keep dark mode working via the semantic tokens.
## Deliverable
One file: `screens/productivity/kanban-board.tsx` exporting KanbanBoardScreen. Preserve the props interface — the host app wires the callbacks (navigation, submit handlers) through them.
## Reference implementation
The LumioUI source for this screen — reproduce it faithfully:
```tsx
import * as React from "react";
import { ScrollView, View } from "react-native";
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
import { Avatar, Button, Glass, Icon, Text } from "@lumioui/ui";
import { BLOCK_STAGGER, Mount, World } from "../shared";
import { useHaptic } from "@lumioui/core";
export interface KanbanCard {
id: string;
title: string;
tag?: string;
tagColor?: string;
assignee?: string;
}
export interface KanbanColumn {
id: string;
title: string;
cards: KanbanCard[];
}
export interface KanbanBoardScreenProps {
board?: string;
columns?: KanbanColumn[];
onCardPress?: (id: string) => void;
onBack?: () => void;
}
const DEFAULT_COLUMNS: KanbanColumn[] = [
{
id: "todo",
title: "To do",
cards: [
{ id: "k1", title: "Empty state for search", tag: "Design", tagColor: "bg-[#65A30D]/15 text-[#65A30D]" },
{ id: "k2", title: "Token swap error copy", tag: "Copy", tagColor: "bg-warning/15 text-warning", assignee: "A" },
{ id: "k6", title: "Boarding-pass dark tint", tag: "Design", tagColor: "bg-[#65A30D]/15 text-[#65A30D]", assignee: "M" },
{ id: "k7", title: "Reminder haptics pass", tag: "Build", tagColor: "bg-success/15 text-success" },
{ id: "k8", title: "List-item density tokens", tag: "Spec", tagColor: "bg-chart-3/15 text-chart-3" },
],
},
{
id: "doing",
title: "In progress",
cards: [
{ id: "k3", title: "Seat-select screen", tag: "Build", tagColor: "bg-success/15 text-success", assignee: "B" },
{ id: "k4", title: "Dark-mode icon audit", assignee: "C" },
{ id: "k9", title: "Registry cache headers", tag: "Build", tagColor: "bg-success/15 text-success", assignee: "A" },
{ id: "k10", title: "Docs search empty state", tag: "Design", tagColor: "bg-[#65A30D]/15 text-[#65A30D]" },
],
},
{
id: "done",
title: "Done",
cards: [
{ id: "k5", title: "Onboarding accents", tag: "Design", tagColor: "bg-[#65A30D]/15 text-[#65A30D]" },
{ id: "k11", title: "Paywall plan cards", tag: "Build", tagColor: "bg-success/15 text-success", assignee: "B" },
{ id: "k12", title: "Icon set — travel batch", tag: "Spec", tagColor: "bg-chart-3/15 text-chart-3", assignee: "M" },
],
},
];
/** Kanban board — horizontal columns, cards with tags + assignee. */
export function KanbanBoardScreen({
board = "Mobile Q4",
columns = DEFAULT_COLUMNS,
onCardPress,
onBack,
}: KanbanBoardScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
return (
<World primary="#65A30D">
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top", "bottom"]}>
<View className="flex-row items-center gap-2 px-4 pb-1 pt-2">
<Button
variant="ghost"
size="icon"
haptic="light"
onPress={() => onBack?.()}
accessibilityLabel="Go back"
className="-ml-2 h-10 w-10"
>
<Icon name="chevron-left" size="md" color="foreground" />
</Button>
<Text variant="h2" accessibilityRole="header">
{board}
</Text>
{/* WIP tally — boards summarize load across lanes. */}
<Text variant="muted" className="text-xs">
{columns.reduce((s, c) => s + c.cards.length, 0)} cards · 2 in review
</Text>
</View>
{/* Columns scroll horizontally; cards stack vertically inside. */}
<ScrollView
horizontal
className="flex-1"
showsHorizontalScrollIndicator={false}
contentContainerStyle={{
paddingHorizontal: 12,
paddingBottom: insets.bottom + 24,
gap: 12,
flexGrow: 1,
}}
>
{columns.map((col, ci) => (
<Mount
key={col.id}
delay={BLOCK_STAGGER * ci}
className="w-[260px] self-stretch overflow-hidden rounded-2xl p-3"
>
<Glass interactive effect="regular" sheen={0.5} className="absolute inset-0 rounded-2xl" pointerEvents="none" />
<View className="flex-row items-center justify-between pb-2">
<Text className="text-sm font-semibold">{col.title}</Text>
<View className="rounded-full bg-muted px-2 py-0.5">
<Text className="text-xs text-muted-foreground">
{col.cards.length}
</Text>
</View>
</View>
<ScrollView
nestedScrollEnabled
showsVerticalScrollIndicator={false}
className="flex-1"
>
{col.cards.map((c) => (
<Button
key={c.id}
variant="ghost"
haptic="light"
onPress={() => onCardPress?.(c.id)}
accessibilityLabel={`Card ${c.title}`}
className="mb-2 w-full items-start overflow-hidden rounded-2xl bg-white p-3 shadow-sm dark:bg-[#1A1A20]"
>
<Text className="text-sm font-medium">{c.title}</Text>
<View className="flex-row items-center justify-between pt-2">
{c.tag && c.tagColor ? (
<View className={`rounded-full px-2 py-0.5 ${c.tagColor.split(" ")[0]}`}>
<Text className={`text-[10px] font-medium ${c.tagColor.split(" ")[1]}`}>
{c.tag}
</Text>
</View>
) : (
<View />
)}
{c.assignee && (
<Avatar size="sm" fallback={c.assignee} alt={c.assignee} className="h-6 w-6" />
)}
</View>
</Button>
))}
<Button
variant="ghost"
haptic="light"
onPress={() => haptics.light()}
accessibilityLabel={`Add card to ${col.title}`}
className="h-9 flex-row items-center gap-1.5 px-2"
>
<Icon name="plus" size="sm" color="mutedForeground" />
<Text className="text-xs text-muted-foreground">Add card</Text>
</Button>
</ScrollView>
</Mount>
))}
{/* Ghost end-column — the "new list" affordance every board app
carries at the tail. */}
<Button
variant="ghost"
haptic="light"
onPress={() => haptics.light()}
accessibilityLabel="Add a new list"
className="w-[260px] self-start items-start rounded-2xl border-2 border-dashed border-border bg-transparent p-4"
>
<View className="flex-row items-center gap-2">
<Icon name="plus" size="sm" color="mutedForeground" />
<Text className="text-sm font-medium text-muted-foreground">
New list
</Text>
</View>
</Button>
</ScrollView>
</SafeAreaView>
</World>
);
}
KanbanBoardScreen.displayName = "KanbanBoardScreen";
```
Screen: https://lumioui.dev/screens/productivity-kanban-board