Skip to content

Commit

Permalink
feat(docs): Add button group documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcmarine committed Jun 11, 2024
1 parent ad20ca3 commit 86ec06f
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/src/components/Example.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const { component: Component } = Astro.props;
---
<div class="mb-8 border-2 divide-y-2">
<div class="p-8 flex justify-center">
<div class="p-8 flex items-center justify-center aspect-video">
{<Component />}
</div>
<slot />
Expand Down
109 changes: 109 additions & 0 deletions docs/src/content/components/button-group.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
title: Button Group
---

import Example from '../../components/Example.astro'

# Button Group

## Default

<Example
component={() => (
<div class="button-group">
<button class="button">add</button>
<button class="button">random</button>
<button class="button">notes</button>
</div>
)}
>
```html
<div class="button-group">
<button class="button">add</button>
<button class="button">random</button>
<button class="button">notes</button>
</div>
```
</Example>

## Full width

<Example
component={() => (
<div class="button-group w-full">
<button class="button w-full">add</button>
<button class="button w-full">random</button>
<button class="button w-full">notes</button>
</div>
)}
>
```html
<div class="button-group w-full">
<button class="button w-full">add</button>
<button class="button w-full">random</button>
<button class="button w-full">notes</button>
</div>
```
</Example>

## Centered

<Example
component={() => (
<div class="button-group w-full text-center">
<button class="button w-full">add</button>
<button class="button w-full">random</button>
<button class="button w-full">notes</button>
</div>
)}
>
```html
<div class="button-group w-full text-center">
<button class="button w-full">add</button>
<button class="button w-full">random</button>
<button class="button w-full">notes</button>
</div>
```
</Example>

## Horizontal

<Example
component={() => (
<div class="button-group button-group--horizontal">
<button class="button">back</button>
<button class="button">add</button>
</div>
)}
>
```html
<div class="button-group button-group--horizontal">
<button class="button">back</button>
<button class="button">add</button>
</div>
```
</Example>

## Compound

<Example
component={() => (
<div class="button-group text-center">
<button class="button w-full">translation</button>
<div class="button-group button-group--horizontal">
<button class="button">back</button>
<button class="button">add</button>
</div>
</div>
)}
>
```html
<div class="button-group text-center">
<button class="button w-full">translation</button>
<div class="button-group button-group--horizontal">
<button class="button">back</button>
<button class="button">add</button>
</div>
</div>
```
</Example>

0 comments on commit 86ec06f

Please sign in to comment.