Skip to content
Cynosurev0.5.0
SearchStorybookGitHubnpmColour mode: System. Switch to Light

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).

Defaults to type button

UsageLink to "Usage"

tsx
Copy
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".

Every prop of ButtonBase
PropWhat it doesTypeDefault
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"

  • type defaults to "button", so it never submits a form by accident. Pass type="submit" to submit.
  • pressed is mirrored to aria-pressed and data-pressed.
  • The ref reaches the native <button>.
  • No styling: components add their own classes.
Mirrors pressed

Button · IconButton

These examples run Cynosure 0.5.0 (commit 50ce30b), the version on npm.

Getting started
Theming
Icons
Accessibility
Code editors and highlighters
Using Cynosure without React
Build-tool adapters
Components
Accordion
AppShell
AspectRatio
Breadcrumbs
Calendar
Card
Container
Disclosure
Divider
DocumentViewport
Grid
Inline
PageHeader
PanZoomCanvas
ScrollArea
SideNav
SortableList
SplitPane
Stack
StatusBar
Tabs
TitleBar
Toolbar
Tree
VirtualList
ZoomControls
Announcer
Avatar
Badge
CodeBlock
DescriptionList
EmptyState
ErrorBoundary
Field
Heading
IconTile
Image
Kbd
List
LoadingDots
Notice
ProgressBar
Prose
Skeleton
Stat
Steps
Table
Text
Button
Checkbox
Checklist
ColorField
ColorSwatches
Combobox
CompareSlider
CopyButton
DateField
FileDrop
IconButton
KeyValueEditor
Link
NumberField
Pagination
PathField
RadioGroup
SearchField
SegmentedControl
Select
SelectionFrame
SignaturePad
Slider
Switch
TagInput
TextArea
TextField
ThemeToggle
TimeField
ButtonBase
ChoiceBase
DialogBase
FileInputBase
HiddenValue
Icon
InputBase
LinkBase
LiveRegion
TextAreaBase
ChatMessage
Choice
DataGrid
DeviceFrame
HighlightedText
HotkeyField
ListRow
OptionList
OverlayFrame
QRCode
RowActions
Section
SiteFooter
SiteHeader
SkipLink
SortButton
VisuallyHidden
CommandPalette
ContextMenu
Dialog
FloatingToolbar
HoverCard
Menu
Menubar
Popover
ProgressOverlay
Sheet
Toast
Tooltip
Changelog