Components / Foundations
ButtonBase
The native <button> for Cynosure, and the only module allowed to render one. It is a foundation: thin, unstyled, and meant to be built on by components rather than used in product code.
Who uses itLink to "Who uses it"
Button, IconButton, Card (when interactive) and Select build on it, along with other composites that need a clickable control.
When to use it directlyLink to "When to use it directly"
Only when you are building a new composite that needs a button with behaviour of its own and none of the existing components fit. Style it with your own classes; ButtonBase adds none.
Use a component instead when you want a normal button (Button) or an icon-only action with a label and tooltip (IconButton).
UsageLink to "Usage"
import { ButtonBase } from "@arshad-shah/cynosure";
<ButtonBase className="my-toggle" pressed={on} onClick={() => setOn(!on)}>
Bold
</ButtonBase>
<ButtonBase type="submit">Send</ButtonBase>PropsLink to "Props"
It accepts every native button attribute except type, which is narrowed to "button" | "submit" | "reset".
| Prop | What it does | Type | Default |
|---|---|---|---|
type | Defaults to "button" so a Cynosure button never submits a form by accident. | "button" | "submit" | "reset" | "button" |
pressed | Toggle state; mirrored to aria-pressed and data-pressed. | boolean |
Generated from the type definitions in @arshad-shah/cynosure 0.5.0.
GuaranteesLink to "Guarantees"
typedefaults to"button", so it never submits a form by accident. Passtype="submit"to submit.pressedis mirrored toaria-pressedanddata-pressed.- The ref reaches the native
<button>. - No styling: components add their own classes.
RelatedLink to "Related"
These examples run Cynosure 0.5.0 (commit 50ce30b), the version on npm.