Responsive flexbox grid with equal-width cells, gap and per-cell classes.
$ npx lumioui add grid
import { Grid } from "@/components/ui/grid/grid";
Files installed into your repo
components/ui/grid/grid.tsx
Native packages required
@lumioui/core@latest
Props5
| columns? | number | Number of columns. Default 2. |
| gap? | number | Gap between cells in px. |
| className? | string | |
| cellClassName? | string | Extra classes for each cell wrapper. |
| children? | React.ReactNode | |
Grid — Categoriescategories.tsx
Live preview offline the relay is unreachable — check back shortly
grid/variants/categories.tsx open Responsive flexbox grid with equal-width cells, gap and per-cell classes.
import { GridCategories } from "@/components/ui/grid/variants/categories";
export function Example() {
return (
<GridCategories />
);
}
import * as React from "react";
import { View } from "react-native";
import { Grid } from "../grid";
import { Icon } from "../../icon/icon";
import { Text } from "../../text/text";
import { Glass } from "../../glass/glass";
const TILES: { icon: Parameters<typeof Icon>[0]["name"]; label: string; color?: string }[] = [
{ icon: "coffee", label: "Broths" },
{ icon: "star", label: "Top rated", color: "warning" },
{ icon: "tag", label: "Under $10" },
{ icon: "moon", label: "Late night" },
{ icon: "map-pin", label: "Near me" },
{ icon: "heart", label: "Saved" },
];
/** GridCategories — six-tile browse grid with a section header. */
export function GridCategories() {
return (
<View className="w-full gap-3">
<Glass interactive curvature="edge" className="w-full gap-3 rounded-2xl p-4">
<View className="flex-row items-center justify-between">
<Text variant="small" className="font-semibold">Browse by category</Text>
<Text variant="muted" className="text-xs">Ramen · Bairro Alto</Text>
</View>
<Grid columns={3} gap={8} className="w-full">
{TILES.map((t) => (
<Glass interactive key={t.label} curvature="edge" className="items-center gap-1 rounded-xl p-3">
<Icon name={t.icon} size="md" color={t.color ?? "foreground"} />
<Text variant="small">{t.label}</Text>
</Glass>
))}
</Grid>
</Glass>
</View>
);
}