Sha256: c0178c9a3aeee49dd5858de9346440e5e29b49f5a5771147ad9fc12ca97e9f17

Contents?: true

Size: 1.08 KB

Versions: 128

Compression:

Stored size: 1.08 KB

Contents

---
title: "Miscellaneous inputs"
label: "Miscellaneous Inputs"
id: miscellaneous_inputs
---

Aside from the set of component-based form inputs, Primer forms also features several additional inputs.

## Hidden inputs

Primer supports standard hidden HTML inputs, eg. `<input type="hidden">`, via the `#hidden` method.

### Usage

<%= code :ruby do %>
  class ExampleForm < ApplicationForm
    form do |example_form|
      example_form.hidden(arguments)
    end
  end
<% end %>

`#hidden` is a thin wrapper around Rails' [`hidden_field` method](https://api.rubyonrails.org/classes/ActionView/Helpers/FormBuilder.html#method-i-hidden_field) and accepts the same arguments.

## Separators

Occasionally it can be appealing to visually distinguish parts of a form from each other. The `#separator` method adds a horizontal rule between inputs.

### Usage

<%= code :ruby do %>
  class ExampleForm < ApplicationForm
    form do |example_form|
      example_form.separator
    end
  end
<% end %>

`#separator` does not accept any arguments.

### Example

<%= embed Primer::FormsPreview, :multi_text_field_form %>

Version data entries

128 entries across 128 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.48.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.47.1 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.47.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
primer_view_components-0.34.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.46.1 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.46.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.45.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.44.3 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.44.2 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.44.1 previews/pages/forms/06_miscellaneous_inputs.md.erb
primer_view_components-0.33.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.44.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.43.1 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.43.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
primer_view_components-0.32.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.42.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
primer_view_components-0.31.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.41.1 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.41.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.40.0 previews/pages/forms/06_miscellaneous_inputs.md.erb