Dashral Pro is hereSee pricing

Dashral

Action Bar

ActionBar with motion: it rises in on a spring, settling with a hint of overshoot, and drops away quicker.

$ pnpm dlx shadcn@latest add @dashral/motion-action-bar
InvoiceCustomerAmount
INV-1048Fernpay$1,240.00
INV-1047Cartwell$860.00
INV-1046Pagewell$420.00
INV-1045Driftbox$2,180.00

Installation

$ pnpm dlx shadcn@latest add @dashral/motion-action-bar

Adds components/dashral/motion/action-bar.tsx, the Action Bar it builds on (in components/dashral/), motion and the motion files every motion component shares. Or by its full URL: https://dashral.com/r/motion-action-bar.json

Usage

The same as Action Bar, imported from components/dashral/motion/ (with the npm package: @dashral/motion/components/action-bar): swap the import and it moves.

example.tsx
import { ActionBar } from "@/components/dashral/motion/action-bar"

<ActionBar open={selected.length > 0} count={selected.length} onClear={() => setSelected([])} actions={<Button size="sm">Archive</Button>} />

Compared with Default

Default

Slides up and fades in CSS, on the spring curve; drops away quicker.

Motion

Rises on the appear spring, settling with a hint of overshoot, and drops away quicker.

How the two editions differ in general, and which to use where: Motion.

API reference

Every prop of Action Bar, and every attribute of the element it renders. The Motion edition adds no props of its own.

ActionBar

Also takes every prop of <div>(opens in a new tab).

PropTypeDefault
openboolean

Whether it shows: usually while something is selected. Required.

—
countnumber

How many are selected: "3 selected", in the locale's plural.

—
labelReactNode

In place of "3 selected".

—
actionsReactNode

The buttons for the selection. Required.

—
onClear() => void

Shows an × that clears the selection; Escape inside the bar calls it too.

—
position"fixed" | "inline"

Floating at the bottom of the window, centred; or in the page's flow.

"fixed"
aria-labelstring

Names the toolbar.

"Actions for the selection"
classNames{ label, actions }

Classes for each part.

—
classNamestring

Extra classes, merged with cn() so yours win.

—

Motion

  • It rises 16px on the appear spring (--duration-standard, a hint of overshoot) and drops away quicker (--ease-exit).
  • With reduced motion it only fades.