Skip to content

Commit d61b283

Browse files
committed
[Docs Site] Add Flex component for responsive image layouts
1 parent df81a1b commit d61b283

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

src/components/Flex.astro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="flex flex-col md:flex-row justify-between gap-x-2 [&_p]:!mt-0">
2+
<slot />
3+
</div>

src/components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export { default as Example } from "./Example.astro";
1515
export { default as ExternalResources } from "./ExternalResources.astro";
1616
export { default as Feature } from "./Feature.astro";
1717
export { default as FeatureTable } from "./FeatureTable.astro";
18+
export { default as Flex } from "./Flex.astro";
1819
export { default as Glossary } from "./Glossary.astro";
1920
export { default as GlossaryDefinition } from "./GlossaryDefinition.astro";
2021
export { default as GlossaryTooltip } from "./GlossaryTooltip.astro";
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: Flex container
3+
---
4+
5+
The `<Flex>` component is intended for showing multiple images in a responsive layout.
6+
7+
A row layout is used on medium-large viewports (i.e laptops or desktops), and a column on small viewports (i.e mobile devices).
8+
9+
## Import
10+
11+
```mdx
12+
import { Flex } from "~/components";
13+
```
14+
15+
## Example
16+
17+
```mdx live
18+
import { Flex } from "~/components";
19+
20+
{/* Make sure there is a newline between images, or Markdown groups them inside one <p> element. */}
21+
22+
<Flex>
23+
![Turnstile Overview](~/assets/images/turnstile/turnstile-overview.png)
24+
25+
![Turnstile Overview](~/assets/images/turnstile/turnstile-overview.png)
26+
</Flex>
27+
28+
<br />
29+
30+
<Flex>
31+
![Turnstile Overview](~/assets/images/turnstile/turnstile-overview.png)
32+
33+
![Turnstile Overview](~/assets/images/turnstile/turnstile-overview.png)
34+
35+
![Turnstile Overview](~/assets/images/turnstile/turnstile-overview.png)
36+
</Flex>
37+
```

0 commit comments

Comments
 (0)