Skip to content

Commit

Permalink
[Docs Site] Add Flex component for responsive image layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
KianNH committed Oct 10, 2024
1 parent df81a1b commit d61b283
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/Flex.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="flex flex-col md:flex-row justify-between gap-x-2 [&_p]:!mt-0">
<slot />
</div>
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export { default as Example } from "./Example.astro";
export { default as ExternalResources } from "./ExternalResources.astro";
export { default as Feature } from "./Feature.astro";
export { default as FeatureTable } from "./FeatureTable.astro";
export { default as Flex } from "./Flex.astro";
export { default as Glossary } from "./Glossary.astro";
export { default as GlossaryDefinition } from "./GlossaryDefinition.astro";
export { default as GlossaryTooltip } from "./GlossaryTooltip.astro";
Expand Down
37 changes: 37 additions & 0 deletions src/content/docs/style-guide/components/flex.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Flex container
---

The `<Flex>` component is intended for showing multiple images in a responsive layout.

A row layout is used on medium-large viewports (i.e laptops or desktops), and a column on small viewports (i.e mobile devices).

## Import

```mdx
import { Flex } from "~/components";
```

## Example

```mdx live
import { Flex } from "~/components";

{/* Make sure there is a newline between images, or Markdown groups them inside one <p> element. */}

<Flex>
![Turnstile Overview](~/assets/images/turnstile/turnstile-overview.png)

![Turnstile Overview](~/assets/images/turnstile/turnstile-overview.png)
</Flex>

<br />

<Flex>
![Turnstile Overview](~/assets/images/turnstile/turnstile-overview.png)

![Turnstile Overview](~/assets/images/turnstile/turnstile-overview.png)

![Turnstile Overview](~/assets/images/turnstile/turnstile-overview.png)
</Flex>
```

0 comments on commit d61b283

Please sign in to comment.