interface

Button

A CTA pill button — accent-filled (primary) or bordered (ghost). It fades and rises in on the house entrance, then plays an optional deterministic click-dip at pressFrame: a quick scale down to 0.94 and back that reads as a press.

$ npx ondajs add button

Button

A CTA pill button. variant="primary" fills with the earned accent; variant="ghost" is transparent with an accent border. It fades and rises in on the house entrance, then plays an optional click-dip at pressFrame — a quick scale down to 0.94 and back that reads as a press. Fully deterministic: the dip is a pure function of the frame's distance from pressFrame, no timers or state.

Props

PropTypeDefaultNotes
labelstring"Get started"Button text.
variant'primary' | 'ghost''primary'Accent fill vs. bordered outline.
accentstring#D96B82Drives the fill, glow, and ghost border/text.
pressbooleantruePlay the click-dip.
pressFramenumber30Frame the dip lands on (local timeline).
delaynumber0Frames before the entrance.
widthnumberFixed width in px; omit for auto width.
fontSizenumber24Label size; wins over size.
sizesize roleCanvas-aware label size; fontSize wins when both passed.
fontFamilystringClash DisplayLabel font.
placementregion or {x,y,anchor}Canvas placement.

Usage

TSX
import { Button } from './components/onda/button/Button';

export const CtaScene = () => (
  <Button label="Get started" variant="primary" pressFrame={30} placement="lower-third" />
);