Skip to content

Commit

Permalink
Visually hidden docs (#691)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
GoldGroove06 and kodiakhq[bot] authored Dec 29, 2024
1 parent c07a415 commit 5f4967c
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/app/docs/components/visually-hidden/docs/codeUsage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const code = {
javascript: {
code: `import VisuallyHidden from "@radui/ui/VisuallyHidden""
const VisualltHiddenExample = () => (
<VisuallyHidden asChild style={{display: "none"}}>
<span>This is a visually hidden text</span>
</VisuallyHidden>
)`
}
}

export default code;
44 changes: 44 additions & 0 deletions docs/app/docs/components/visually-hidden/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const PAGE_NAME = 'VISUALLY_HIDDEN_DOCS'
import Documentation from "@/components/layout/Documentation/Documentation"


import VisuallyHidden from "@radui/ui/VisuallyHidden"
import SEO from "../../docsIndex"
export const metadata = SEO.getMetadata(PAGE_NAME)

import codeUsage from "./docs/codeUsage"

const VisuallyHiddenDocs = () => {

const columns = [
{name: 'Prop', key: 'prop'},
{name: 'Type', key: 'type'},
{name: 'Default', key: 'default'},
{name: 'Description', key: 'description'},
];

const data = [
{prop: 'asChild', type: 'boolean', default: 'false', description: 'renders the children in desired element'},

];


return <div>
<Documentation currentPage={PAGE_NAME} title='Visually Hidden' description={`Use these helpers to visually hide elements but keep them accessible to assistive technologies.`}>
<Documentation.ComponentHero codeUsage={codeUsage}>
<div>
<VisuallyHidden asChild style={{display: "none"}}>
<span>This is a visually hidden text</span>
</VisuallyHidden>
</div>
</Documentation.ComponentHero>


<div >
<Documentation.Table columns={columns} data={data} />
</div>
</Documentation>
</div>
}

export default VisuallyHiddenDocs;
4 changes: 4 additions & 0 deletions docs/components/navigation/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ const sections = [
{
title: "Tooltip",
path: "/docs/components/tooltip"
},
{
title: "VisuallyHidden",
path: "/docs/components/visually-hidden"
}
]
},
Expand Down

0 comments on commit 5f4967c

Please sign in to comment.