Skip to content
Cynosurev0.5.0
SearchStorybookGitHubnpmColour mode: System. Switch to Light

Components / More

RowActions

The buttons at the end of a row: out of the way until the row is pointed at or holds focus, always shown on touch screens, and in the Tab order only on the row that holds the Tab stop. ListRow, Tree and ChatMessage draw their actions with it; use it for a row of your own.

Shown while the row holds focus

When to useLink to "When to use"

  • A row (a list entry, a tree item, a message) with a few commands of its own that would clutter every row if always shown.

Use something else when:

  • the commands are the main thing the row does: make the row a button or a link (ListRow with onClick or href).
  • the controls always show: a Toolbar or an Inline of buttons.
  • the row is a whole list of rows: ListRow and Tree already render it.

UsageLink to "Usage"

tsx
Copy
import { IconButton, RowActions } from "@arshad-shah/cynosure";

<li className="file-row">
  <Button ref={main}>report.pdf</Button>
  <RowActions tabbable={main}>
    <IconButton icon={edit} label="Rename" variant="ghost" size="sm" />
    <IconButton icon={trash} label="Delete" variant="ghost" size="sm" />
  </RowActions>
</li>

The row is the element that holds RowActions: hovering it, or focus anywhere in it, shows the actions. When the row is a larger element around it, mark that element with data-row-actions-host (ChatMessage marks the whole message).

In the tab order only on the tab stop row

PropsLink to "Props"

Every prop of RowActions
PropWhat it doesTypeDefault
children
The controls: IconButtons, a Menu, a Toolbar of them.ReactNode
tabbable
Whether the controls are in the Tab order. A ref to the row's own control (the one a list's roving focus moves between): they are in it only while that control is the list's Tab stop, or always when the ref is empty (a row that cannot be pressed). true or false: always or never. Left out: their own tabindex is left alone (a Toolbar inside manages it).boolean | RefObject<HTMLElement | null>
shown
Shown whatever the pointer does, such as on a selected row. Default false.booleanfalse
className
Added to the root element, for layout (its place in the row).string
style
Layout only. Restyle through --cy-row-actions-* tokens.CSSProperties

Generated from the type definitions in @arshad-shah/cynosure 0.5.0.

Behaviour and accessibilityLink to "Behaviour and accessibility"

  • With a mouse (hover: hover) the actions are hidden by opacity only: they keep their place, so nothing moves when they show, and they stay focusable, so focus reveals them. They show while the row is hovered or holds focus, while a menu of theirs is open, and with shown (a selected row).
  • On touch screens (no hover) they are always shown; each button keeps a 44px hit area.
  • tabbable with a ref to the row's own control: the actions are in the Tab order only while that control is the list's Tab stop (roving focus moves it), and always for a row with no control. true or false: always or never. Left out, their own tabindex is kept, as for a Toolbar inside, whose arrows move between them.
Behaviour and accessibility, table 1
KeyAction
TabFrom the row's control (the Tab stop) to its actions, then on
Shift+TabBack to the row's control

TouchLink to "Touch"

Always shown: there is no hover to wait for.

Touch shows them always

ThemingLink to "Theming"

Tokens: --cy-row-actions-gap (between the controls) and --cy-row-actions-background (behind them, for actions drawn over a row, as ListRow does with the row's own colour).

ListRow · Tree · ChatMessage · IconButton · Menu

These examples run Cynosure 0.5.0 (commit 50ce30b), the version on npm.

Getting started
Theming
Icons
Accessibility
Code editors and highlighters
Using Cynosure without React
Build-tool adapters
Components
Accordion
AppShell
AspectRatio
Breadcrumbs
Calendar
Card
Container
Disclosure
Divider
DocumentViewport
Grid
Inline
PageHeader
PanZoomCanvas
ScrollArea
SideNav
SortableList
SplitPane
Stack
StatusBar
Tabs
TitleBar
Toolbar
Tree
VirtualList
ZoomControls
Announcer
Avatar
Badge
CodeBlock
DescriptionList
EmptyState
ErrorBoundary
Field
Heading
IconTile
Image
Kbd
List
LoadingDots
Notice
ProgressBar
Prose
Skeleton
Stat
Steps
Table
Text
Button
Checkbox
Checklist
ColorField
ColorSwatches
Combobox
CompareSlider
CopyButton
DateField
FileDrop
IconButton
KeyValueEditor
Link
NumberField
Pagination
PathField
RadioGroup
SearchField
SegmentedControl
Select
SelectionFrame
SignaturePad
Slider
Switch
TagInput
TextArea
TextField
ThemeToggle
TimeField
ButtonBase
ChoiceBase
DialogBase
FileInputBase
HiddenValue
Icon
InputBase
LinkBase
LiveRegion
TextAreaBase
ChatMessage
Choice
DataGrid
DeviceFrame
HighlightedText
HotkeyField
ListRow
OptionList
OverlayFrame
QRCode
RowActions
Section
SiteFooter
SiteHeader
SkipLink
SortButton
VisuallyHidden
CommandPalette
ContextMenu
Dialog
FloatingToolbar
HoverCard
Menu
Menubar
Popover
ProgressOverlay
Sheet
Toast
Tooltip
Changelog