Docs / Components / Button
ven.js

Button

venjs.button(props, ...children) — a styled button with two variants and a press-scale interaction.

Signature

venjs.button(props, ...children) → VNode

Props

PropTypeDescription
variant"primary" | "outline""outline" gives a bordered, transparent button; otherwise the solid primary style is used.
classstringAppended after the component’s default classes (use to override/add utilities).
any button attribute / eventonclick, disabled, type, etc. are forwarded.

Example

venjs.button({ onclick: () => save() }, "Save");
venjs.button({ variant: "outline", onclick: cancel }, "Cancel");

Default styling

The base classes are px-6 py-2.5 rounded-xl font-bold transition-all active:scale-95 flex items-center justify-center gap-2, plus the variant classes:

  • primary (default): bg-blue-600 text-white shadow-lg hover:shadow-blue-200
  • outline: border-2 border-blue-600 text-blue-600 hover:bg-blue-50