Button
Triggers an action. Four variants and four sizes, a loading state that keeps focus, and a look that comes entirely from the active skin.
Installation
Set up Camaleo once (Installation), then import what you need. The skin you load styles it.
import { Button, IconButton, ButtonGroup } from "@camaleo/react";Anatomy
One element with up to three parts. Every part has a data-slot you can target from CSS.
Examples
Every example is a real file you can copy. They all wear the skin, mode and brand from the bar above.
Sizes
sm, md and lg follow the skin's control heights, so a form and its buttons always line up.
With an icon
Put the icon before the label for something new, after it for direction or download. Mark it data-slot="icon" and aria-hidden.
Icon only
IconButton requires aria-label. Pair it with a Tooltip so sighted users get the name too.
As a link
Navigation is a link, not a button. render={<a href="…" />} with nativeButton={false} keeps the look and gives you a real anchor.
Saving, then saved
Click it. loading keeps the width and the focus while the request runs; a status message announces the result.
Destructive, with a confirm
Click it. A danger action opens an AlertDialog. The safe choice comes first and gets focus.
Grouped
ButtonGroup joins related actions under role="group". For arrow-key navigation between them, use Toolbar.
Accept the terms to continue.
Disabled, with a reason
Never leave people guessing. Say what is missing and link it with aria-describedby, or keep the button enabled and validate on submit.
In context
Buttons are never alone. These are whole pieces of UI you can copy, in the skin you picked.
Team
$24 per seat / month
- Unlimited projects
- Shared skins and tokens
- Priority support
No projects yet
Create your first project or import one from a file.
Cookies
We use cookies to keep you signed in and, if you agree, to measure what helps.
Guidelines
It tells people what the main action is.
Nothing stands out, so nothing is clear.
Say what happens: "Create invoice", "Save changes".
"OK" and "Click here" mean nothing out of context, or to a screen reader listing the buttons.
Props
solid for the main action, outline for secondary ones, ghost for quiet ones, danger for destructive ones.icon makes it square.ReactElement or a function that returns the element to render.<button> element when replacing it
via the render prop.
Set to false if the rendered element is not a button (for example, <div>).IconButton takes the same props without size, plus a required aria-label. Native button attributes pass through.
Styling hooks
Restyle it without forking: target the attributes, or set the tokens on a parent, a skin or the button itself.
Attributes
Tokens it reads
Color
Shape & size
Type & motion
This component only
/* a pill-shaped primary, only in this section */
.checkout [data-slot="button"][data-variant="solid"] {
--cml-radius-control: 999px;
}Accessibility
- Text and focus ring pass WCAG 2.2 AA in all 13 skins, light and dark, with any brand color.
- While loading it sets aria-busy and stays focusable, so keyboard and screen reader users keep their place.
- Rendered as another element through render, it keeps the button role and keyboard behavior.
- Respects reduced motion: the press effect and the spinner calm down.