summaryrefslogtreecommitdiffstats
path: root/toolkit/content/widgets/moz-label/README.stories.md
blob: a3492ebefabdaa770ecc94138fb42c99ff455b16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# MozLabel

`moz-label` is an extension of the built-in `HTMLLabelElement` that provides accesskey styling and formatting as well as some click handling logic.

```html story
<label is="moz-label" accesskey="c" for="check">
    This is a label with an accesskey:
</label>
<input id="check" type="checkbox" defaultChecked />
```

Accesskey underlining is enabled by default on Windows and Linux. It is also enabled in Storybook on Mac for demonstrative purposes, but is usually controlled by the `ui.key.menuAccessKey` preference.

## Component status

At this time `moz-label` may not be suitable for general use in Firefox.

`moz-label` is currently only used in the `moz-toggle` custom element. There are no instances in Firefox where we set an accesskey on a toggle, so it is still largely untested in the wild.

Additionally there is at least [one outstanding bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1819469) related to accesskey handling in the shadow DOM.