| asChild | boolean | false | headless | Renders the child element instead of a native <button>, merging all
props — aria-, data-, event handlers, ref — onto it via
Slot. type is not forwarded in this mode; the child owns its
own type semantics. See the asChild example on Button. |
| children | ReactNode | — | headless | Button content. Under asChild, becomes the single child element Slot merges props onto. |
| ref | Ref<HTMLButtonElement> | — | headless | Allows getting a ref to the component instance.
Once the component unmounts, React will set ref.current to null
(or call the ref with null if you passed a callback ref).
Forwarded to the underlying HTMLButtonElement, or — under
asChild — merged onto the rendered child via Slot. |
| type | "button" | "submit" | "reset" | "button" | headless | The button's native type attribute, restricted to the three valid
values. Defaults to "button" (not the DOM's own default of
"submit"), so a Button placed inside a <form> never triggers an
accidental submit unless set explicitly. |
| variant | "primary" | "secondary" | "danger" | "ghost" | "link" | primary | styled | Visual intent / emphasis. |
| size | "xs" | "sm" | "md" | "lg" | "xl" | md | styled | Control size; data-density scales each size further. |