Components/CellLink

CellLink

A table-cell link whose host decides how to open it.

VerifiedSince 0.3.9

Usage

Basic

underline picks a permanent or hover-only underline; a click only emits open and never navigates.

Loading demo...

Best Practices

  • When the text is a bare domain, add an ariaLabel such as "Open the Aurora Scoops website".
  • Use muted with underline="hover" for record-name columns, and the default color with underline="always" for link columns.
  • In the Electron renderer, route open through the host's external-browser channel; don't open windows in the renderer.
  • Render a placeholder such as — for a cell with no link, not a TxCellLink with an empty href.

API Reference

Props

PropTypeDefaultDescription
hrefstring-Target URL, written into the real href.
labelstringhrefVisible text; falls back to href.
externalbooleanfalseAppends the outbound arrow.
mutedbooleanfalseUses the secondary ink instead of the link color, for record-name columns.
underline'always' | 'hover''hover'hover shows it on hover and focus only; always keeps a tinted underline.
ariaLabelstring-Accessible name when the visible text doesn't describe the destination.

Events

EventPayloadDescription
open({ href, event })Fires on click after preventDefault(); the host navigates.

Slots

NameDescription
defaultReplaces the link text.

Overview

  • Renders a native <a href>, so copy-link, hover preview, and the context menu work, and Enter fires open too.
  • Never navigates on its own: in the Electron renderer, a self-navigating link would take the app window with it. Same contract as TxSources.
  • The outbound arrow is aria-hidden; put the destination in ariaLabel.
  • Long text truncates with an ellipsis instead of widening the cell.

Technologies

  • Source: packages/tuffex/packages/components/src/cell-link/.
  • Adapted from Beautiful UI (© 2026 Shane Levine, MIT); upstream navigates directly, this port emits open instead.
查看源码
packages/tuffex/packages/components/src/cell-link/index.ts