Checkbox
Defines a checkbox
Provides a wrapper for Phoenix.HTML.Form's checkbox/3
function.
All options passed via opts
will be sent to checkbox/3
, value
and
class
can be set directly and will override anything in opts
.
# Public API
Name | Description | Type | Values | Default |
---|---|---|---|---|
id
| The id of the corresponding input field. |
:string
| — | — |
opts
| Options list. |
:keyword
| — |
[]
|
class
| Class or classes to apply to the input. |
:css_class
| — | — |
value
| Value to pre-populated the input. |
:string
| — | — |
name
| The name of the corresponding input field. |
:string
| — | — |
field
| An identifier for the input. |
:any
| — | — |
form
| An identifier for the form. |
:form
| — | — |
values
| List values that will be sent as part of the payload triggered by an event. |
:keyword
| — |
[]
|
checked_value
| The value to be sent when the checkbox is checked. Defaults to "true". |
:any
| — |
true
|
hidden_input
| Controls if this function will generate a hidden input to submit the unchecked value or not, defaults to "true". |
:boolean
| — |
true
|
unchecked_value
| The value to be sent when the checkbox is unchecked, defaults to "false". |
:any
| — |
false
|
Name | Description | Arguments |
---|
Name | Description |
---|---|
keydown
|
Triggered when a key on the keyboard is pressed. |
keyup
|
Triggered when a key on the keyboard is released. |
window_keydown
|
Triggered when a key on the keyboard is pressed (window-level). |
window_keyup
|
Triggered when a key on the keyboard is released (window-level). |
blur
|
Triggered when the component loses focus. |
focus
|
Triggered when the component receives focus. |
window_blur
|
Triggered when the page loses focus. |
window_focus
|
Triggered when the page receives focus. |
click
|
Triggered when the component receives click. |
capture_click
|
Triggered when the component captures click. |
Name | Description |
---|