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
primer_view_components-0.36.5 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.52.2 previews/pages/forms/06_miscellaneous_inputs.md.erb
primer_view_components-0.36.4 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.52.1 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.52.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
primer_view_components-0.36.3 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.51.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
primer_view_components-0.36.2 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.50.1 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.50.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
primer_view_components-0.36.1 previews/pages/forms/06_miscellaneous_inputs.md.erb
primer_view_components-0.36.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.49.2 previews/pages/forms/06_miscellaneous_inputs.md.erb
primer_view_components-0.35.2 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.49.1 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.49.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
primer_view_components-0.35.1 previews/pages/forms/06_miscellaneous_inputs.md.erb
primer_view_components-0.35.0 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.48.2 previews/pages/forms/06_miscellaneous_inputs.md.erb
openproject-primer_view_components-0.48.1 previews/pages/forms/06_miscellaneous_inputs.md.erb