Form
NewOverview
A wrapper around Phoenix.Component.form, with a little bit of styling and a requirement for id.
<Form.form
for={@project_form}
id="example-project-form"
class="example-fields mx-auto w-full max-w-92.5"
>
<Input.input field={@project_form[:name]} label="Project name" placeholder="New website" />
<Textarea.textarea
field={@project_form[:description]}
label="Description"
placeholder="Describe the project..."
/>
<Button.button type={:submit}>Create project</Button.button>
</Form.form>
Add this module
mix dizzy.add form
Component API
Form.form
Attributes
| Name | Type | Default | Values |
|---|---|---|---|
action |
:string
| nil | โ |
as |
:atom
| nil | โ |
class |
:any
| nil | โ |
csrf_token |
:any
| nil | โ |
errors |
:list
| nil | โ |
for |
:any
| Required | โ |
id |
:string
| Required | โ |
method |
:string
| nil | โ |
multipart |
:boolean
| false | โ |
rest |
:global
| nil | โ |
Slots
| Name | Required | Attributes |
|---|---|---|
inner_block | Required | โ |