"use client"; import React from "react"; import { Table } from "@/subframe/components/Table"; import { Badge } from "@/subframe/components/Badge"; import { DropdownMenu } from "@/subframe/components/DropdownMenu"; import * as SubframeCore from "@subframe/core"; import { IconButton } from "@/subframe/components/IconButton"; function TableExample() { return ( <Table header={ <Table.HeaderRow> <Table.HeaderCell>Name</Table.HeaderCell> <Table.HeaderCell>Email</Table.HeaderCell> <Table.HeaderCell>Role</Table.HeaderCell> </Table.HeaderRow> } > <Table.Row> <Table.Cell> <span className="whitespace-nowrap text-body-bold font-body-bold text-neutral-700"> John Walton </span> </Table.Cell> <Table.Cell> <span className="whitespace-nowrap text-body font-body text-neutral-500"> [email protected] </span> </Table.Cell> <Table.Cell> <Badge>Engineering</Badge> </Table.Cell> <Table.Cell> <div className="flex grow shrink-0 basis-0 items-center justify-end"> <SubframeCore.DropdownMenu.Root> <SubframeCore.DropdownMenu.Trigger asChild={true}> <IconButton size="medium" icon="FeatherMoreHorizontal" onClick={(event: React.MouseEvent<HTMLButtonElement>) => {}} /> </SubframeCore.DropdownMenu.Trigger> <SubframeCore.DropdownMenu.Portal> <SubframeCore.DropdownMenu.Content side="bottom" align="end" sideOffset={8} asChild={true} > <DropdownMenu /> </SubframeCore.DropdownMenu.Content> </SubframeCore.DropdownMenu.Portal> </SubframeCore.DropdownMenu.Root> </div> </Table.Cell> </Table.Row> <Table.Row> <Table.Cell> <span className="whitespace-nowrap text-body-bold font-body-bold text-neutral-700"> Sarah Chandler </span> </Table.Cell> <Table.Cell> <span className="whitespace-nowrap text-body font-body text-neutral-500"> [email protected] </span> </Table.Cell> <Table.Cell> <Badge variant="warning">Design</Badge> </Table.Cell> <Table.Cell> <div className="flex grow shrink-0 basis-0 items-center justify-end"> <SubframeCore.DropdownMenu.Root> <SubframeCore.DropdownMenu.Trigger asChild={true}> <IconButton size="medium" icon="FeatherMoreHorizontal" onClick={(event: React.MouseEvent<HTMLButtonElement>) => {}} /> </SubframeCore.DropdownMenu.Trigger> <SubframeCore.DropdownMenu.Portal> <SubframeCore.DropdownMenu.Content side="bottom" align="end" sideOffset={8} asChild={true} > <DropdownMenu /> </SubframeCore.DropdownMenu.Content> </SubframeCore.DropdownMenu.Portal> </SubframeCore.DropdownMenu.Root> </div> </Table.Cell> </Table.Row> <Table.Row> <Table.Cell> <span className="whitespace-nowrap text-body-bold font-body-bold text-neutral-700"> Susan Best </span> </Table.Cell> <Table.Cell> <span className="whitespace-nowrap text-body font-body text-neutral-500"> [email protected] </span> </Table.Cell> <Table.Cell> <Badge variant="success">Product</Badge> </Table.Cell> <Table.Cell> <div className="flex grow shrink-0 basis-0 items-center justify-end"> <SubframeCore.DropdownMenu.Root> <SubframeCore.DropdownMenu.Trigger asChild={true}> <IconButton size="medium" icon="FeatherMoreHorizontal" onClick={(event: React.MouseEvent<HTMLButtonElement>) => {}} /> </SubframeCore.DropdownMenu.Trigger> <SubframeCore.DropdownMenu.Portal> <SubframeCore.DropdownMenu.Content side="bottom" align="end" sideOffset={8} asChild={true} > <DropdownMenu /> </SubframeCore.DropdownMenu.Content> </SubframeCore.DropdownMenu.Portal> </SubframeCore.DropdownMenu.Root> </div> </Table.Cell> </Table.Row> </Table> ); } export default TableExample;
header
React.ReactNode
children
<table>
onClick
className