Merge pull request #1648 from ing-bank/chore/add-doc-label-sr-only
chore: add eg for label-sr-only attribute on input element
This commit is contained in:
commit
c29d622c92
1 changed files with 13 additions and 0 deletions
|
|
@ -13,6 +13,19 @@ Can be provided via the `label` attribute or via the `slot="label"`.
|
|||
export const label = () => html` <lion-input label="Input" name="input"></lion-input> `;
|
||||
```
|
||||
|
||||
## Label sr-only (a11y)
|
||||
|
||||
Can be provided via the `label-sr-only` boolean attribute.
|
||||
|
||||
The label will be hidden, but still readable by screen readers.
|
||||
|
||||
```js preview-story
|
||||
export const labelSrOnly = () =>
|
||||
html` <lion-input label-sr-only label="Input" name="input"></lion-input> `;
|
||||
```
|
||||
|
||||
> Note: Once we support the ElementInternals API, the equivalent will be `<lion-input aria-label="Input" name="input"></lion-input>`
|
||||
|
||||
## Help-text
|
||||
|
||||
A helper text shown below the label to give extra clarification.
|
||||
|
|
|
|||
Loading…
Reference in a new issue