Floating Actions
A floating bar for surfacing contextual actions, typically shown when items are selected.1<div2 style={{3 position: "relative",4 width: "100%",5 height: 240,6 transform: "translateZ(0)",7 }}8>9 <FloatingActions aria-label="Selection actions">10 <Chip11 variant="outline"12 size="large"13 color="accent"14 leadingIcon={<CheckCircledIcon />}15 isDismissible
Anatomy
Import and assemble the component:
1import { FloatingActions, Chip, Button } from "@raystack/apsara";23<FloatingActions aria-label="Selection actions">4 <Chip isDismissible>2 selected</Chip>5 <FloatingActions.Separator />6 <Button>Move to</Button>7 <Button>Actions</Button>8</FloatingActions>
API Reference
Built on top of Base UI's Toolbar primitive, so keyboard navigation, roving focus, and the role="toolbar" semantics come from the primitive.
Root
The container. Pins itself to the viewport by default (variant="floating") and forwards all <div> attributes to the underlying Toolbar primitive.
Prop
Type
Group
Cluster related items so that the toolbar treats them as a single navigation unit. Useful when you want a destructive cluster (e.g. "Delete") to read as one section, separated from the rest of the bar by a Separator.
Prop
Type
Separator
A vertical divider sized to the bar's content. Built on top of Separator.
Prop
Type
Variants
floating (default) renders with position: fixed anchored to the viewport via side and align — use it when the bar should follow the user as the page scrolls (bulk-selection toolbars, contextual action trays). inline opts out of viewport positioning so the bar flows with surrounding content.
1<div2 style={{3 position: "relative",4 width: "100%",5 alignSelf: "stretch",6 transform: "translateZ(0)",7 }}8>9 <div style={{ height: "100%", overflowY: "auto" }}>10 <div11 style={{12 height: 500,13 border: "2px dashed var(--rs-color-border-base-secondary)",14 margin: "var(--rs-space-4)",15 boxSizing: "border-box",
Examples
Bulk actions
Pair a dismissible Chip with action buttons to build a selection toolbar.
1<div style={{ paddingBlock: "var(--rs-space-9)" }}>2 <FloatingActions variant="inline" aria-label="Bulk actions">3 <Chip4 variant="outline"5 size="large"6 color="accent"7 leadingIcon={<CheckCircledIcon />}8 isDismissible9 >10 5 selected11 </Chip>12 <FloatingActions.Separator />13 <Button variant="outline" color="neutral" size="small">14 Archive15 </Button>
Icon-only actions
Use IconButton inside the bar for compact toolbars.
1<div style={{ paddingBlock: "var(--rs-space-9)" }}>2 <FloatingActions3 variant="inline"4 aria-label="Row actions"5 style={{ gap: "var(--rs-space-5)" }}6 >7 <IconButton aria-label="Edit" variant="text" color="neutral" size="small">8 <Pencil2Icon />9 </IconButton>10 <IconButton aria-label="Upload" variant="text" color="neutral" size="small">11 <UploadIcon />12 </IconButton>13 <FloatingActions.Separator />14 <IconButton15 aria-label="More info"
Side
side controls which vertical edge of the viewport the bar pins to.
1<div2 style={{3 position: "relative",4 width: "100%",5 alignSelf: "stretch",6 minHeight: 240,7 transform: "translateZ(0)",8 }}9>10 <div11 style={{12 position: "absolute",13 inset: "0 var(--rs-space-4)",14 border: "2px dashed var(--rs-color-border-base-secondary)",15 boxSizing: "border-box",
Align
align controls the horizontal alignment of the bar along the chosen side.
1<div2 style={{3 position: "relative",4 width: "100%",5 alignSelf: "stretch",6 minHeight: 240,7 transform: "translateZ(0)",8 }}9>10 <div11 style={{12 position: "absolute",13 inset: "0 var(--rs-space-4)",14 border: "2px dashed var(--rs-color-border-base-secondary)",15 boxSizing: "border-box",
Grouped actions
Use FloatingActions.Group to cluster related items so they navigate as one unit, separated from the rest of the bar by a Separator.
1<div style={{ paddingBlock: "var(--rs-space-9)" }}>2 <FloatingActions variant="inline" aria-label="Bulk actions">3 <Chip4 variant="outline"5 size="large"6 color="accent"7 leadingIcon={<CheckCircledIcon />}8 isDismissible9 >10 3 selected11 </Chip>12 <FloatingActions.Separator />13 <FloatingActions.Group>14 <Button variant="outline" color="neutral" size="small">15 Archive
Scrolling context
The floating variant stays pinned to the viewport (or the nearest containing block) while content scrolls beneath it — the canonical use case for a bulk-selection bar over a long list or table.
1(function ScrollingDemo() {2 return (3 <div4 style={{5 position: "relative",6 width: "100%",7 height: "320px",8 transform: "translateZ(0)",9 }}10 >11 <div style={{ height: "100%", overflowY: "auto" }}>12 <div13 style={{14 height: "800px",15 border: "2px dashed var(--rs-color-border-base-secondary)",
Use with DataTable
For the row-selection pattern — rendering this bar over a DataTable and wiring it to selected rows — see DataTable → Row selection.
Accessibility
- The root uses
role="toolbar"(enforced by the Base UI Toolbar primitive) and is announced as a group of interactive controls. Keyboard focus moves between toolbar items with the arrow keys. - The separator renders with
role="separator"andaria-orientation="vertical"via the Base UI primitive, communicating structural grouping between action clusters. - Provide an
aria-labelon the root when the toolbar's purpose is not obvious from its contents (e.g.aria-label="Selection actions").