Skip to content

Commit

Permalink
Visually hidden docs
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldGroove06 committed Dec 28, 2024
1 parent 4bdfa8b commit f12b246
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
18 changes: 18 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,18 @@
const code = {
javascript: {
code: `import VisuallyHidden from "@radui/ui/VisuallyHidden""
const VisualltHiddenExample = () => (
<VisuallyHidden asChild>
<span>This is a visually hidden text</span>
</VisuallyHidden>
)`
},
scss: {
code: `.rad-ui-visually-hidden {
display: none;
}`
},
}

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>
<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 @@ -154,6 +154,10 @@ const sections = [
{
title: "Tooltip",
path: "/docs/components/tooltip"
},
{
title: "VisuallyHidden",
path: "/docs/components/visually-hidden"
}
]
},
Expand Down

0 comments on commit f12b246

Please sign in to comment.