j3w1 / theme

j3w1 / theme4.0.0

j3w1 / command

  • SPEC Overview
  • SPEC Foundations
  • SPEC Components
  • SPEC Patterns
  • SPEC Tokens
  • SPEC Tools
  • SPEC Workbench
  • SPEC Form builder
  • SPEC Task kit
  • SPEC Recipes
  • SPEC Figma bridge
  • SPEC Report an issue
  • SPEC Implement
  • SPEC For agents
  • SPEC Ports
  • SPEC Releases
  • SPEC Specification
  • DEMO Vue application demo

Fieldset

The native fieldset that groups related fields under a legend inside a 1px divider border; disabling it disables everything inside.

stable · light DOM · 4.0.0. Light DOM retains static content, native semantics, label relationships and host composition without duplicating controls.

Live variants

default

Window gaps

Pixels between windows.

Negative values overlap the screen edge.

Markup
<j3w1-fieldset id="example-fieldset-default"><fieldset class="fieldset">
  <legend class="fieldset-legend">Window gaps</legend>
  <div class="fieldset-body">
    <div class="fieldset-field">
      <label class="fieldset-label" for="example-fieldset-default-fs-inner">Inner gap</label>
      <input class="fieldset-input" id="example-fieldset-default-fs-inner" type="text" inputmode="numeric" value="14" aria-describedby="example-fieldset-default-fs-inner-help" name="example-fieldset-default-fs-inner">
      <p class="fieldset-help" id="example-fieldset-default-fs-inner-help">Pixels between windows.</p>
    </div>
    <div class="fieldset-field">
      <label class="fieldset-label" for="example-fieldset-default-fs-outer">Outer gap</label>
      <input class="fieldset-input" id="example-fieldset-default-fs-outer" type="text" inputmode="numeric" value="-2" aria-describedby="example-fieldset-default-fs-outer-help" name="example-fieldset-default-fs-outer">
      <p class="fieldset-help" id="example-fieldset-default-fs-outer-help">Negative values overlap the screen edge.</p>
    </div>
  </div>
</fieldset></j3w1-fieldset>

Install and register

Use the exact version. If npm publication is pending, install the release tarball from the installation guide.

npm install --save-exact @j3w1/ui@4.0.0
import '@j3w1/ui/tokens.css';
import '@j3w1/ui/styles/fieldset.css';
import '@j3w1/ui/register/fieldset';

Insert the maintained markup above after loading these imports. Its native children provide accessible names and form behavior; the empty custom tag alone does not create a control.

Vue SFC, React, Astro and plain HTML integration →

Copy the complete implementation

npx --package=@j3w1/ui@4.0.0 j3w1-ui copy fieldset --out ./vendor/j3w1/fieldset

The CLI verifies every file before writing and refuses overwrites. Serve the output over HTTP and open index.html. Keep its modules, CSS, tokens and licence notices together.

Public API

attributes

NameType / signatureMeaning
disabledCustomEventDisable the native controls owned by this instance.
loadingCustomEventMark the primary control busy and prevent duplicate activation.

properties

NameType / signatureMeaning
disabledbooleanDelegates disabled state to native children.
namestringNative control name; application form keys remain explicit.

methods

NameType / signatureMeaning
refresh(): voidReconnect behavior after replacing native child structure.
focus(options?: FocusOptions): voidFocus the first usable native control.

events

NameType / signatureMeaning

Dependencies and verification

Registered components: none. Style dependencies: none.

Package presence establishes an available implementation. Actual passes depend on the tested artifact and environment. Read specification execution evidence; read packed-consumer evidence; inspect the complete state matrix.

Full implementation manifest, API and token dependency closure

Canonical specification

Fieldset fieldset

  • Family: Basic forms
  • Maturity: stable
  • Priority: R1
  • Since: 0.1.0
  • Native control: native <fieldset> with <legend> — APG pattern
  • specified
  • demonstrated

The native fieldset that groups related fields under a legend inside a 1px divider border; disabling it disables everything inside.

Report an issue with this component

Tokens

Focus a role to inspect its values; follow its link for persistent usage and source details.

PartRoleValueUse
root.bordercolor.border.dividerapproveduse#482b2bD-041 border.divider: color.primitive.modern.divider.
root.bgcolor.surface.defaultapproveduse#0d0707D-041 surface.default: color.primitive.modern.panel.
legend.textcolor.text.brightapproveduse#ffa2a7D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
body.textcolor.text.defaultapproveduse#e99499D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
legend.text-disabledcolor.text.disabledapproveduse#a3676bD-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
field.bgcolor.surface.inputapproveduse#000000Form-control fill.
field.bordercolor.border.controlapproveduse#c81a1aD-041 owner correction: red control and floating-frame borders, distinct from rose text.
field.bg-disabledcolor.interaction.disabled.bgapproveduse#0d0707D-041 interaction.disabled.bg: color.primitive.modern.panel.
field.border-disabledcolor.border.disabledapproveduse#482b2bD-041 border.disabled: color.primitive.modern.divider.
field.text-disabledcolor.text.disabledapproveduse#a3676bD-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
help.textcolor.text.mutedapproveduse#d4868bD-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.

State matrix

Every declared state and combination, statically rendered; the default cell is live. Sizes: compact, comfortable (switch with the density control above).

StateDefault
default
Window gaps

Pixels between windows.

Negative values overlap the screen edge.

disabled

Purpose

Groups fields that belong together: an address, a set of credentials, the options of one feature. Checkbox and radio groups use their own components, which are fieldsets too.

Anatomy

Parts as listed in the anatomy. The border is a decorative section rule; the legend and the spacing carry the grouping.

States

StateVisualNon-colour channel
default1px color.border.divider border; legend color.text.bright; fields as their own componentsthe border and the legend
disabledlegend and labels color.text.disabled; each control takes its own disabled treatment (color.interaction.disabled.bg, color.border.disabled); border unchangeddisabled on the fieldset; cursor: not-allowed on the controls

Keyboard

None of its own; a disabled group’s controls leave the tab order natively.

Accessibility

The legend names the group and is announced before its first field; it says what the group is, not what to do. Groups nest at most two levels. Because disabling hides controls from keyboard users, a disabled group states why in text before it or keeps its controls enabled. Legend, labels and help meet 4.5:1.

Portability

Hosts without a legend-in-border draw the heading above the box and record it. Disabled propagation is native on the web, GTK and Qt; a host without it disables each control.

Non-examples

No legend, or a visually hidden one. A card instead of a fieldset for form controls. Rounded corners. A 2px or border.control border, which reads as a control. A legend in accent red. Disabling only the legend. Three levels of nesting.

Contrast report

7 declared pairs measured on resolved sRGB values with the WCAG 2.x formula; 0 waived (decorative only), 0 failing. A pass is a design target for the named role, not an application-wide conformance claim.

PairStateKindForegroundBackgroundRatioMinResult
fieldset default textdefaulttextcolor.text.bright #ffa2a7color.surface.default #0d070710.454.5pass
group border (decorative; the legend and spacing carry the grouping)—uicolor.border.divider #482b2bcolor.surface.default #0d07071.581pass
field labels inside the group—textcolor.text.default #e99499color.surface.default #0d07078.724.5pass
help text inside the group—textcolor.text.muted #d4868bcolor.surface.default #0d07077.224.5pass
disabled legend and labels (exempt; house floor 3:1)disableduicolor.text.disabled #a3676bcolor.surface.default #0d07074.483pass
disabled field text (exempt; house floor 3:1)disableduicolor.text.disabled #a3676bcolor.interaction.disabled.bg #0d07074.483pass
disabled field border (exempt)disableduicolor.border.disabled #482b2bcolor.interaction.disabled.bg #0d07071.581pass

Keys

KeyAction
Tab / Shift+TabMoves through the fields inside in document order; the legend is not a tab stop.

For agents

Component JSON ·Implementation brief ·Build a task kit ·

Related: field checkbox radio-group text-field card

Stress fixtures: FX-LONG FX-320 FX-ZOOM-200 FX-I18N FX-RTL FX-RM FX-HC FX-DENSITY FX-STATE-MATRIX