Button
| Prop | Type | Default | Description |
|---|---|---|---|
disabled | boolean | false | Disable the button. |
asChild | boolean | false | Render onto the child element. |
A button primitive with native semantics and disabled state.
import { Button } from '@milkui/react/button';
export function SaveButton() {
return <Button>Save changes</Button>;
}import { Button } from '@milkui/react/button';
<Button />React defaults to type="button"; an explicit type prop overrides it. Use the disabled prop to disable it.
| Prop | Type | Default | Description |
|---|---|---|---|
disabled | boolean | false | Disable the button. |
asChild | boolean | false | Render onto the child element. |
| Attribute | Values |
|---|---|
[disabled] | Present when disabled |
[mlk-button] | Button marker |
Disabled buttons keep native button semantics and do not fire click actions.
<Button disabled>
Save changes
</Button>Button renders a native button, so it follows browser button behavior.
| Key | Description |
|---|---|
Space | Activates the button. |
Enter | Activates the button. |
Tab | Moves focus to the next focusable element. |