Visually hidden
v0.0.10
v0.0.10StableMobStatelessApache-2.0
Installation
mix mishka.ui.gen.mob visually_hidden
Source
View Source
The Mishka Chelekom Mob Visually Hidden component is the native port of the headless Visually Hidden, which hides content from the screen and keeps it for screen readers. On iOS and Android screens built with Mob it is the one component in the port that cannot do its job: it renders nothing.
What to do instead
- Put the text in the visible label. A phone usually has room, and a visible label helps everyone.
- For an icon-only control, use an
Imagewith adescription. Mob.Speechcan speak a string outright, which covers the live region case.
For Mob.Speech and Image, see the Mob documentation.
Props
The component ignores every prop. Its public API is the function below.
| Prop | Type | Default | Description |
|---|---|---|---|
announce?/0 | helper | false | Whether hidden text can reach a screen reader. It always returns false today. |
Differences from the web component
The web component keeps its content in the accessibility tree while hiding it. The Mob component keeps nothing: it renders an empty node and drops its children.
Attributes
This component takes no attributes.
Options
Each option takes one or more of its values, separated by commas.
| Option | Values |
|---|---|
--type
|
visually_hidden
|
--module
| A module name of your own |
What it generates
Functions
visually_hidden
Helpers
None
Generated with it
None
Command
mix mishka.ui.gen.mob visually_hidden