A container that prevents the click event from bubbling out of it.
Each table row will trigger a window.alert() when clicked. The icon button is wrapped in SandboxedOnClick and navigates you to the ngrok docs.
1import { IconButton } from "@ngrok/mantle/button";2import { SandboxedOnClick } from "@ngrok/mantle/sandboxed-on-click";3import { Table } from "@ngrok/mantle/table";4import { BookIcon } from "@phosphor-icons/react/Book";5 6<Table.Root>7 <Table.Element>8 <Table.Caption>A list of your recent invoices.</Table.Caption>9 <Table.Head>10 <Table.Row>11 <Table.Header className="w-25">Invoice</Table.Header>12 <Table.Header>Status</Table.Header>13 <Table.Header>Method</Table.Header>14 <Table.Header className="text-right">Amount</Table.Header>15 <Table.Header className="text-right">Actions</Table.Header>16 </Table.Row>17 </Table.Head>18 <Table.Body>19 {invoices.map((invoice) => (20 <Table.Row21 key={invoice.invoice}22 className="cursor-pointer"23 onClick={() => {24 window.alert(`Clicked on ${invoice.invoice}!`);25 }}26 >27 <Table.Cell className="font-medium">{invoice.invoice}</Table.Cell>28 <Table.Cell>{invoice.paymentStatus}</Table.Cell>29 <Table.Cell>{invoice.paymentMethod}</Table.Cell>30 <Table.Cell className="text-right">{invoice.totalAmount}</Table.Cell>31 <Table.Cell className="text-right">32 <SandboxedOnClick allowClickEventDefault>33 <IconButton label="See ngrok docs" icon={<BookIcon />} asChild>34 <a href="https://ngrok.com/docs" target="_blank" rel="noopener noreferrer" />35 </IconButton>36 </SandboxedOnClick>37 </Table.Cell>38 </Table.Row>39 ))}40 </Table.Body>41 <Table.Foot>42 <Table.Row>43 <Table.Cell colSpan={3}>Total</Table.Cell>44 <Table.Cell className="text-right">$2,500.00</Table.Cell>45 <Table.Cell />46 </Table.Row>47 </Table.Foot>48 </Table.Element>49</Table.Root>;A container that prevents the click event from bubbling out of it. Good to use when you want to provide some action buttons inside of a table row or list item that navigates on click.
All props from div, plus: