import * as React from "react"; import { TableBuilder, TableBuilderColumn } from "baseui/table-semantic"; import { Avatar } from "baseui/avatar"; import { Button, KIND, SIZE } from "baseui/button"; import { Tag } from "baseui/tag"; import { useStyletron } from "baseui"; import { ArrowUp, ArrowDown } from "baseui/icon"; const ROW = { foo: 10, bar: "banana", url: "https://example.com/b", largeNumber: 1000000, avatarSrc: "https://avatars.dicebear.com/api/human/3.svg?width=285&mood=happy", name: "User Name", title: "Job Title", list: ["One", "Two", "Three"], }; type Row = typeof ROW; const DATA = Array.from(new Array(20)).fill(ROW); function AvatarCell({ src, title, subtitle, }: { src: string; title: string; subtitle: string; }) { const [css, theme] = useStyletron(); return (

{title}

{subtitle}

); } function NumberCell({ value, delta }: { value: number; delta: number }) { const [css, theme] = useStyletron(); const positive = delta >= 0; return (
{new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", }).format(value)}
{positive ? : } {delta}%
); } function TagsCell({ tags }: { tags: Array }) { const [css] = useStyletron(); return (
{tags.map((tag) => { return ( {tag} ); })}
); } function ButtonsCell({ labels }: { labels: Array }) { const [css, theme] = useStyletron(); return (
{labels.map((label, index) => { return ( ); })}
); } export default function Example() { return ( header="Avatar"> {(row) => ( )} header="Number positive"> {(row) => } header="Number negative"> {(row) => } header="Tags"> {(row) => } header="Buttons"> {(row) => } ); }