All components
Striped Rows Table
tablesOrigin UI component.
responsive · 600px
Install
Same command in any shadcn project — React (Vite/CRA), Next.js, Remix, Astro, and more:
$
npx shadcn@latest add https://your-domain/r/comp-469.jsonUsage
import Cmp from "@/registry/origin-ui/comp-469";
export default function Demo() {
return <Cmp />;
}Component source
import {
Table,
TableBody,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
} from "@/components/ui/table";
const items = [
{
balance: "$1,250.00",
email: "alex.t@company.com",
id: "1",
location: "San Francisco, US",
name: "Alex Thompson",
status: "Active",
},
{
balance: "$600.00",
email: "sarah.c@company.com",
id: "2",
location: "Singapore",
name: "Sarah Chen",
status: "Active",
},
{
balance: "$650.00",
email: "j.wilson@company.com",
id: "3",
location: "London, UK",
name: "James Wilson",
status: "Inactive",
},
{
balance: "$0.00",
email: "m.garcia@company.com",
id: "4",
location: "Madrid, Spain",
name: "Maria Garcia",
status: "Active",
},
{
balance: "-$1,000.00",
email: "d.kim@company.com",
id: "5",
location: "Seoul, KR",
name: "David Kim",
status: "Active",
},
];
export default function Component() {
return (
<div>
<Table>
<TableHeader className="bg-transparent">
<TableRow className="hover:bg-transparent">
<TableHead>Name</TableHead>
<TableHead>Email</TableHead>
<TableHead>Location</TableHead>
<TableHead>Status</TableHead>
<TableHead className="text-right">Balance</TableHead>
</TableRow>
</TableHeader>
<tbody aria-hidden="true" className="table-row h-2" />
<TableBody className="[&_td:first-child]:rounded-l-lg [&_td:last-child]:rounded-r-lg">
{items.map((item) => (
<TableRow
className="border-none odd:bg-muted/50 hover:bg-transparent odd:hover:bg-muted/50"
key={item.id}
>
<TableCell className="py-2.5 font-medium">{item.name}</TableCell>
<TableCell className="py-2.5">{item.email}</TableCell>
<TableCell className="py-2.5">{item.location}</TableCell>
<TableCell className="py-2.5">{item.status}</TableCell>
<TableCell className="py-2.5 text-right">
{item.balance}
</TableCell>
</TableRow>
))}
</TableBody>
<tbody aria-hidden="true" className="table-row h-2" />
<TableFooter className="bg-transparent">
<TableRow className="hover:bg-transparent">
<TableCell colSpan={4}>Total</TableCell>
<TableCell className="text-right">$2,500.00</TableCell>
</TableRow>
</TableFooter>
</Table>
<p className="mt-4 text-center text-muted-foreground text-sm">
Striped table
</p>
</div>
);
}Source: Origin UI