Numbered fieldset

A variation of fieldset that allows for numbered fieldsets.

This component relies on the fieldset component.

Step-highlighting

There is Javascript that highlights the step that the user is currently focussing on. This is only visual and is not keeping track of skipping required form items for example.

This component relies on the fieldset component.

Possible assumption

This component assumes that there is no other component that has a function with this name: compony_theme_suggestions_fieldset_alter

If your theme already has this exact function name in use, you should copy the contents of this function and put them in the already existing one. (every function name in php has to be unique).

Implementing

When defining a fieldset in the backend, you can add the step variable as follows:

$form['something'] = [
  '#type' => 'fieldset',
  '#title' => $this->t('My fieldset title'),
  '#step' => 1,
];

The step will be used as the number of the fieldset.

Specifications

Machine name

fieldset--numbered

Perks

Using Sass
Responsive
Using Drupal behaviours
Accessible

Drawbacks

Uses jQuery

Building blocks

HTML
CSS
Javascript

Inspired by

Flat design

Stats

Public component
35 downloads
No open issue

Contributors