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

NEXT: Cookbook Image Layouts #2786

Merged
merged 2 commits into from
Aug 15, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
layout: '@layouts/LayoutDoc.astro'
title: Image Layouts
description: Layouts for displaying sets of images.
showDocsUrl: true
---

export const components = componentSet;

import ExampleGrid from '@examples/resources/cookbook/image-layouts/ExampleGrid.astro';
import ExampleGridRaw from '@examples/resources/cookbook/image-layouts/ExampleGrid.astro?raw';
import ExampleQuad from '@examples/resources/cookbook/image-layouts/ExampleQuad.astro';
import ExampleQuadRaw from '@examples/resources/cookbook/image-layouts/ExampleQuad.astro?raw';
import ExampleMasonry from '@examples/resources/cookbook/image-layouts/ExampleMasonry.astro';
import ExampleMasonryRaw from '@examples/resources/cookbook/image-layouts/ExampleMasonry.astro?raw';
import ExampleFeatured from '@examples/resources/cookbook/image-layouts/ExampleFeatured.astro';
import ExampleFeaturedRaw from '@examples/resources/cookbook/image-layouts/ExampleFeatured.astro?raw';

## Grid

<Preview client:load>
<Fragment slot="preview">
<ExampleGrid />
</Fragment>
<Fragment slot="code">
<Code code={ExampleGridRaw} lang="astro" />
</Fragment>
</Preview>

## Quad

<Preview client:load>
<Fragment slot="preview">
<ExampleQuad />
</Fragment>
<Fragment slot="code">
<Code code={ExampleQuadRaw} lang="astro" />
</Fragment>
</Preview>

## Masonry

<Preview client:load>
<Fragment slot="preview">
<ExampleMasonry />
</Fragment>
<Fragment slot="code">
<Code code={ExampleMasonryRaw} lang="astro" />
</Fragment>
</Preview>

## Featured

<Preview client:load>
<Fragment slot="preview">
<ExampleFeatured />
</Fragment>
<Fragment slot="code">
<Code code={ExampleFeaturedRaw} lang="astro" />
</Fragment>
</Preview>

## Attribution

Images courtesy of [Lorem Picsum](https://picsum.photos/). Markup and styles inspired by [Flowbite](https://flowbite.com/docs/components/gallery/#masonry-grid).
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<section class="grid gap-4">
<!-- Featured -->
<header>
<img class="h-auto max-w-full bg-surface-500 rounded-container" src="https://picsum.photos/960/512?random=1" />
</header>
<!-- Row -->
<div class="grid grid-cols-5 gap-4">
<img class="h-full w-full bg-surface-500 rounded-container" src="https://picsum.photos/200/200?random=2" />
<img class="h-full w-full bg-surface-500 rounded-container" src="https://picsum.photos/200/200?random=3" />
<img class="h-full w-full bg-surface-500 rounded-container" src="https://picsum.photos/200/200?random=4" />
<img class="h-full w-full bg-surface-500 rounded-container" src="https://picsum.photos/200/200?random=5" />
<img class="h-full w-full bg-surface-500 rounded-container" src="https://picsum.photos/200/200?random=6" />
</div>
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<section class="grid grid-cols-2 gap-6 md:grid-cols-3">
<!-- Row -->
<img class="w-48 h-48 bg-surface-500 rounded-container" src="https://picsum.photos/192/192?random=1" />
<img class="w-48 h-48 bg-surface-500 rounded-container" src="https://picsum.photos/192/192?random=2" />
<img class="w-48 h-48 bg-surface-500 rounded-container" src="https://picsum.photos/192/192?random=3" />
<!-- Row -->
<img class="w-48 h-48 bg-surface-500 rounded-container" src="https://picsum.photos/192/192?random=4" />
<img class="w-48 h-48 bg-surface-500 rounded-container" src="https://picsum.photos/192/192?random=5" />
<img class="w-48 h-48 bg-surface-500 rounded-container" src="https://picsum.photos/192/192?random=6" />
<!-- Row -->
<img class="w-48 h-48 bg-surface-500 rounded-container" src="https://picsum.photos/192/192?random=7" />
<img class="w-48 h-48 bg-surface-500 rounded-container" src="https://picsum.photos/192/192?random=8" />
<img class="w-48 h-48 bg-surface-500 rounded-container" src="https://picsum.photos/192/192?random=9" />
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<section class="grid grid-cols-2 gap-4 md:grid-cols-4">
<!-- Column -->
<div class="grid gap-4">
<img class="bg-surface-500 rounded-container" src="https://picsum.photos/220/320?random=1" />
<img class="bg-surface-500 rounded-container" src="https://picsum.photos/220/120?random=2" />
<img class="bg-surface-500 rounded-container" src="https://picsum.photos/220/280?random=3" />
</div>
<!-- Column -->
<div class="grid gap-4">
<img class="bg-surface-500 rounded-container" src="https://picsum.photos/220/300?random=4" />
<img class="bg-surface-500 rounded-container" src="https://picsum.photos/220/280?random=5" />
<img class="bg-surface-500 rounded-container" src="https://picsum.photos/220/140?random=6" />
</div>
<!-- Column -->
<div class="grid gap-4">
<img class="bg-surface-500 rounded-container" src="https://picsum.photos/220/280?random=7" />
<img class="bg-surface-500 rounded-container" src="https://picsum.photos/220/320?random=8" />
<img class="bg-surface-500 rounded-container" src="https://picsum.photos/220/140?random=9" />
</div>
<!-- Column -->
<div class="grid gap-4">
<img class="bg-surface-500 rounded-container" src="https://picsum.photos/220/320?random=10" />
<img class="bg-surface-500 rounded-container" src="https://picsum.photos/220/140?random=11" />
<img class="bg-surface-500 rounded-container" src="https://picsum.photos/220/280?random=12" />
</div>
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<section class="grid grid-cols-2 gap-4">
<img class="h-64 w-64 bg-surface-500 rounded-container" src="https://picsum.photos/256/256?random=1" />
<img class="h-64 w-64 bg-surface-500 rounded-container" src="https://picsum.photos/256/256?random=2" />
<img class="h-64 w-64 bg-surface-500 rounded-container" src="https://picsum.photos/256/256?random=3" />
<img class="h-64 w-64 bg-surface-500 rounded-container" src="https://picsum.photos/256/256?random=4" />
</section>
Loading