-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2dfe0fa
commit 853eac2
Showing
4 changed files
with
219 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import { Meta, Primary, Controls, Story } from '@storybook/blocks' | ||
import * as ButtonGroupStories from './button-group.stories' | ||
import { defaultButtonGroupConfig } from '.' | ||
|
||
<Meta of={ButtonGroupStories} /> | ||
|
||
# Button group | ||
|
||
When building web applications, it is often necessary to provide the user with a set of actions that can be performed on a given page. Actions can be grouped together in a button group. | ||
|
||
<Primary /> | ||
|
||
## Props | ||
|
||
<Controls /> | ||
|
||
## Variants | ||
|
||
<br /> | ||
|
||
### Size: sm | ||
|
||
Button groups act as containers that group buttons together, taking care of spacing and border radiuses. Below is a small button group example. | ||
|
||
<div className="flex gap-2 bg-slate-100 dark:bg-slate-900 p-6 rounded-sm"> | ||
<Story of={ButtonGroupStories.SizeSm} /> | ||
</div> | ||
|
||
<br /> | ||
|
||
### Size: md | ||
|
||
Button groups act as containers that group buttons together, taking care of spacing and border radiuses. Below is a medium button group example. | ||
|
||
<div className="flex gap-2 bg-slate-100 dark:bg-slate-900 p-6 rounded-sm"> | ||
<Story of={ButtonGroupStories.SizeMd} /> | ||
</div> | ||
|
||
<br /> | ||
|
||
### Size: Lg | ||
|
||
Button groups act as containers that group buttons together, taking care of spacing and border radiuses. Below is a large button group example. | ||
|
||
<div className="flex gap-2 bg-slate-100 dark:bg-slate-900 p-6 rounded-sm"> | ||
<Story of={ButtonGroupStories.SizeLg} /> | ||
</div> | ||
|
||
<br /> | ||
<br /> | ||
|
||
## Slots | ||
|
||
### Slot: default | ||
|
||
Button groups have a default slot that serves as wrapper for their inner content. | ||
|
||
<div className="flex gap-2 bg-slate-100 dark:bg-slate-900 p-6 rounded-sm"> | ||
<Story of={ButtonGroupStories.Main} /> | ||
</div> | ||
|
||
<br /> | ||
<br /> | ||
|
||
## Customization | ||
|
||
### Default config | ||
|
||
<div class="relative"> | ||
<details class="relative bg-slate-50 border border-slate-200 rounded-lg p-4 [&>summary>svg]:open:-rotate-180"> | ||
<summary class="list-none cursor-pointer"> | ||
<span class="font-sans text-slate-500">View configuration options</span> | ||
<svg | ||
class="w-5 h-5 text-slate-500 absolute top-5 end-4 transition-transform duration-300" | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="32" | ||
height="32" | ||
viewBox="0 0 24 24" | ||
> | ||
<path | ||
fill="none" | ||
stroke="currentColor" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
stroke-width="2" | ||
d="m6 9l6 6l6-6" | ||
/> | ||
</svg> | ||
</summary> | ||
|
||
<div class="!mt-4"> | ||
<pre > | ||
{JSON.stringify(defaultButtonGroupConfig, null, 2)} | ||
</pre> | ||
</div> | ||
|
||
</details> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters