Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aspect Ratio docs #690

Merged
merged 2 commits into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/app/docs/components/aspect-ratio/docs/codeUsage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const code = {
javascript: {
code: `import AspectRatio from "@radui/ui/AspectRatio"`

const AspectRatioExample = () => (
<AspectRatio ratio='16/9'>
<img
style={{ width: '100%', height: '100%', objectFit: 'cover' }}
className="Image"
src="https://images.pexels.com/photos/346529/pexels-photo-346529.jpeg?cs=srgb&dl=pexels-bri-schneiter-28802-346529.jpg&fm=jpg"
alt="Landscape photograph"
/>
</AspectRatio>
)`

}
}


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


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

import codeUsage from "./docs/codeUsage"

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

const data = [
{prop: 'ratio', type: 'string', default: '1', description: 'Used to set desired ratio'},

];
return <div>
<Documentation currentPage={PAGE_NAME} title='Aspect Ratio' description={`
Aspect Ratio is used to set the desired ratio.
`}>
<Documentation.ComponentHero codeUsage={codeUsage}>
<div>
<AspectRatio ratio='16/9'>
<img
style={{ width: '100%', height: '100%', objectFit: 'cover' }}
className="Image"
src="https://images.pexels.com/photos/346529/pexels-photo-346529.jpeg?cs=srgb&dl=pexels-bri-schneiter-28802-346529.jpg&fm=jpg"
alt="Landscape photograph"
/>
</AspectRatio>
</div>
</Documentation.ComponentHero>
<div className="max-w-screen-md">
<Documentation.Table columns={columns} data={data} />
</div>
</Documentation>

</div>
}

export default AspectRatioDocs;
4 changes: 4 additions & 0 deletions docs/components/navigation/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ const sections = [
title: "Avatar",
path: "/docs/components/avatar"
},
{
title: "AspectRatio",
path: "/docs/components/aspect-ratio"
},
{
title: "Badge",
path: "/docs/components/badge"
Expand Down
Loading