A <fieldset>
groups several related form-fields (and their <label>
s) together within a single <form>
. A <legend>
inside of a <fieldset>
provides a caption that describes the field grouping.
The default browser-defined styling for a <fieldset>
and <legend>
doesn't fit with our desired style, so SWAN features its own Fieldset component that overrides the default. This lets you make use of the nice accessibility benefits of <fieldset>
and <legend>
without having to use the browser's default visuals.
Usage
For comparison, here is a <fieldset>
with the default styling: