Search documentation of phoenix_kit

# PhoenixKitWeb.Components.Core.SimpleForm (phoenix_kit v1.7.87)

Copy Markdown View Source

Provides a simple form UI component.

## Summary

### Functions

simple_form(assigns)

Renders a simple form.

## Functions

# simple_form(assigns)

Renders a simple form.

## Examples

    <.simple_form for={@form} phx-submit="save">
      <.input field={@form[:email]} type="email" label="Email"/>
      <.input field={@form[:password]} type="password" label="Password" />
      <:actions>
        <.button>Save</.button>
      </:actions>
    </.simple_form>

## Attributes

- `for` (`:any`) (required) - the datastructure for the form.
- `as` (`:any`) - the server side parameter to collect all input under. Defaults to `nil`.
- Global attributes are accepted. the arbitrary HTML attributes to apply to the form tag. Supports all globals plus: `["autocomplete", "name", "rel", "action", "enctype", "method", "novalidate", "target", "multipart"]`.

## Slots

- `inner_block` (required)
- `actions` - the slot for form actions, such as a submit button.