-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: visually hidden docs and demos (#3203)
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
docs/content/components/visually-hidden/visually-hidden.demo.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Text, VisuallyHidden } from '@marigold/components'; | ||
|
||
export default () => ( | ||
<> | ||
<Text>The Text below is visually hidden</Text> | ||
<VisuallyHidden>I am invisible</VisuallyHidden> | ||
</> | ||
); |
36 changes: 36 additions & 0 deletions
36
docs/content/components/visually-hidden/visually-hidden.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
title: VisuallyHidden | ||
group: Content | ||
caption: Component to hide its children. | ||
--- | ||
|
||
`<VisuallyHidden>` is a utility component that can be used to hide its children visually, while keeping them visible to screen readers and other assistive technology. | ||
|
||
This would typically be used when you want to take advantage of the behavior and semantics of a native element like a checkbox or radio button, but replace it with a custom styled element visually. | ||
|
||
## Usage | ||
|
||
### Import | ||
|
||
To import the component you just have to use this code below. | ||
|
||
```tsx | ||
import { VisuallyHidden } from '@marigold/components'; | ||
``` | ||
|
||
### Props | ||
|
||
<PropsTable | ||
props={[ | ||
{ | ||
property: 'isFocusable', | ||
type: 'boolean', | ||
description: 'Whether the element should become visible on focus.', | ||
default: 'false', | ||
}, | ||
]} | ||
/> | ||
|
||
## Examples | ||
|
||
<ComponentDemo file="./visually-hidden.demo.tsx" /> |