Skip to content

zk-button ​

Renders a <button> element. Optionally wraps in a field structure.

Props ​

PropTypeDefaultDescription
typestring'button'Button type: button, submit, reset
namestring|nullnullname attribute
valuemixednullvalue attribute — uses old() automatically
formstring|nullnullAssociates with a form by id
disabledboolfalseAdds disabled attribute
autofocusboolfalseAdds autofocus attribute
classstring|nullnullCSS class(es) merged onto the element
iconstring|nullnullMaterial Symbols icon name — rendered as data-icon attribute
fieldboolfalseWrap in field structure (off by default)
fieldClassstring|nullnullCSS class(es) on the field wrapper

Examples ​

Basic button ​

blade
<x-zk-button>Click me</x-zk-button>

With icon (data attribute for CSS) ​

blade
<x-zk-button icon="add" class="btn-primary">Add item</x-zk-button>
{{-- renders: <button ... data-icon="add" class="btn-primary">Add item</button> --}}

Disabled ​

blade
<x-zk-button :disabled="! $form->isDirty()">Save</x-zk-button>

Alpine.js integration ​

blade
<x-zk-button @click="open = true" x-bind:disabled="loading">Open</x-zk-button>

Notes ​

  • zk-submit and zk-reset are thin wrappers around this component with type pre-set.
  • field defaults to false unlike most form components — buttons rarely need a field wrapper.

Documentation of 3.2.0 , built from c93e21f on 3.2.0 by pipeline #2919741884 on 2026-10-06.