mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
docs(button-group): update
This commit is contained in:
@@ -9,8 +9,87 @@ links:
|
||||
|
||||
## Usage
|
||||
|
||||
Wrap multiple [Button](/components/button) within a ButtonGroup to group them together.
|
||||
|
||||
::component-code
|
||||
---
|
||||
slots:
|
||||
default: |
|
||||
|
||||
<UButton color="gray" variant="subtle" label="Button" />
|
||||
<UButton color="gray" variant="outline" icon="i-heroicons-chevron-down-20-solid" />
|
||||
---
|
||||
:u-button{color="gray" variant="subtle" label="Button"}
|
||||
:u-button{color="gray" variant="outline" icon="i-heroicons-chevron-down-20-solid"}
|
||||
::
|
||||
|
||||
### Size
|
||||
|
||||
Use the `size` prop to change the size of all the buttons.
|
||||
|
||||
::component-code
|
||||
---
|
||||
props:
|
||||
size: md
|
||||
slots:
|
||||
default: |
|
||||
|
||||
<UButton color="gray" variant="subtle" label="Button" />
|
||||
<UButton color="gray" variant="outline" icon="i-heroicons-chevron-down-20-solid" />
|
||||
---
|
||||
:u-button{color="gray" variant="subtle" label="Button"}
|
||||
:u-button{color="gray" variant="outline" icon="i-heroicons-chevron-down-20-solid"}
|
||||
::
|
||||
|
||||
### Orientation
|
||||
|
||||
Use the `orientation` prop to change the orientation of the buttons.
|
||||
|
||||
::component-code
|
||||
---
|
||||
props:
|
||||
orientation: vertical
|
||||
slots:
|
||||
default: |
|
||||
|
||||
<UButton color="gray" variant="subtle" label="Submit" />
|
||||
<UButton color="gray" variant="outline" label="Cancel" />
|
||||
---
|
||||
:u-button{color="gray" variant="subtle" label="Submit"}
|
||||
:u-button{color="gray" variant="outline" label="Cancel"}
|
||||
::
|
||||
|
||||
## Examples
|
||||
|
||||
### With input
|
||||
|
||||
You can use components like [Input](/components/input), [InputMenu](/components/input-menu), [Select](/components/select) [SelectMenu](/components/select-menu), etc. within a button group.
|
||||
|
||||
::component-code
|
||||
---
|
||||
slots:
|
||||
default: |
|
||||
|
||||
<UInput color="gray" variant="outline" placeholder="Enter token" />
|
||||
|
||||
<UButton color="gray" variant="subtle" icon="i-heroicons-clipboard-document" />
|
||||
---
|
||||
:u-input{color="gray" variant="outline" placeholder="Enter token"}
|
||||
:u-button{color="gray" variant="subtle" icon="i-heroicons-clipboard-document"}
|
||||
::
|
||||
|
||||
### With tooltip
|
||||
|
||||
You can use a tooltip within a button group.
|
||||
|
||||
:component-example{name="button-group-tooltip-example"}
|
||||
|
||||
### With dropdown
|
||||
|
||||
You can use a dropdown menu within a button group.
|
||||
|
||||
:component-example{name="button-group-dropdown-example"}
|
||||
|
||||
## API
|
||||
|
||||
### Props
|
||||
|
||||
Reference in New Issue
Block a user