mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-28 10:50:40 +01:00
docs(button-group): update
This commit is contained in:
@@ -6,12 +6,14 @@
|
|||||||
alt="Benjamin Canac"
|
alt="Benjamin Canac"
|
||||||
/>
|
/>
|
||||||
</UChip>
|
</UChip>
|
||||||
|
|
||||||
<UChip inset color="amber">
|
<UChip inset color="amber">
|
||||||
<UAvatar
|
<UAvatar
|
||||||
src="https://avatars.githubusercontent.com/u/25613751?v=4"
|
src="https://avatars.githubusercontent.com/u/25613751?v=4"
|
||||||
alt="Romain Hamel"
|
alt="Romain Hamel"
|
||||||
/>
|
/>
|
||||||
</UChip>
|
</UChip>
|
||||||
|
|
||||||
<UChip inset color="red">
|
<UChip inset color="red">
|
||||||
<UAvatar
|
<UAvatar
|
||||||
src="https://avatars.githubusercontent.com/u/19751938?v=4"
|
src="https://avatars.githubusercontent.com/u/19751938?v=4"
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
alt="Benjamin Canac"
|
alt="Benjamin Canac"
|
||||||
/>
|
/>
|
||||||
</ULink>
|
</ULink>
|
||||||
|
|
||||||
<ULink
|
<ULink
|
||||||
to="https://github.com/romhml"
|
to="https://github.com/romhml"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@@ -22,6 +23,7 @@
|
|||||||
alt="Romain Hamel"
|
alt="Romain Hamel"
|
||||||
/>
|
/>
|
||||||
</ULink>
|
</ULink>
|
||||||
|
|
||||||
<ULink
|
<ULink
|
||||||
to="https://github.com/noook"
|
to="https://github.com/noook"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|||||||
@@ -6,12 +6,14 @@
|
|||||||
alt="Benjamin Canac"
|
alt="Benjamin Canac"
|
||||||
/>
|
/>
|
||||||
</UTooltip>
|
</UTooltip>
|
||||||
|
|
||||||
<UTooltip text="romhml">
|
<UTooltip text="romhml">
|
||||||
<UAvatar
|
<UAvatar
|
||||||
src="https://avatars.githubusercontent.com/u/25613751?v=4"
|
src="https://avatars.githubusercontent.com/u/25613751?v=4"
|
||||||
alt="Romain Hamel"
|
alt="Romain Hamel"
|
||||||
/>
|
/>
|
||||||
</UTooltip>
|
</UTooltip>
|
||||||
|
|
||||||
<UTooltip text="noook">
|
<UTooltip text="noook">
|
||||||
<UAvatar
|
<UAvatar
|
||||||
src="https://avatars.githubusercontent.com/u/19751938?v=4"
|
src="https://avatars.githubusercontent.com/u/19751938?v=4"
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
const items = [{
|
||||||
|
label: 'Team',
|
||||||
|
icon: 'i-heroicons-users'
|
||||||
|
}, {
|
||||||
|
label: 'Invite users',
|
||||||
|
icon: 'i-heroicons-user-plus',
|
||||||
|
children: [{
|
||||||
|
label: 'Invite by email',
|
||||||
|
icon: 'i-heroicons-paper-airplane'
|
||||||
|
}, {
|
||||||
|
label: 'Invite by link',
|
||||||
|
icon: 'i-heroicons-link'
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
label: 'New team',
|
||||||
|
icon: 'i-heroicons-plus'
|
||||||
|
}]
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<UButtonGroup>
|
||||||
|
<UButton color="gray" variant="subtle" label="Settings" />
|
||||||
|
|
||||||
|
<UDropdownMenu :items="items">
|
||||||
|
<UButton
|
||||||
|
color="gray"
|
||||||
|
variant="outline"
|
||||||
|
icon="i-heroicons-chevron-down-20-solid"
|
||||||
|
/>
|
||||||
|
</UDropdownMenu>
|
||||||
|
</UButtonGroup>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<template>
|
||||||
|
<UButtonGroup>
|
||||||
|
<UInput color="gray" variant="outline" placeholder="Enter token" />
|
||||||
|
|
||||||
|
<UTooltip text="Copy to clipboard">
|
||||||
|
<UButton
|
||||||
|
color="gray"
|
||||||
|
variant="subtle"
|
||||||
|
icon="i-heroicons-clipboard-document"
|
||||||
|
/>
|
||||||
|
</UTooltip>
|
||||||
|
</UButtonGroup>
|
||||||
|
</template>
|
||||||
@@ -15,6 +15,7 @@ Wrap multiple [Avatar](/components/avatar) within an AvatarGroup to stack them.
|
|||||||
---
|
---
|
||||||
slots:
|
slots:
|
||||||
default: |
|
default: |
|
||||||
|
|
||||||
<UAvatar src="https://avatars.githubusercontent.com/u/739984?v=4" alt="Benjamin Canac" />
|
<UAvatar src="https://avatars.githubusercontent.com/u/739984?v=4" alt="Benjamin Canac" />
|
||||||
<UAvatar src="https://avatars.githubusercontent.com/u/25613751?v=4" alt="Romain Hamel" />
|
<UAvatar src="https://avatars.githubusercontent.com/u/25613751?v=4" alt="Romain Hamel" />
|
||||||
<UAvatar src="https://avatars.githubusercontent.com/u/19751938?v=4" alt="Neil Richter" />
|
<UAvatar src="https://avatars.githubusercontent.com/u/19751938?v=4" alt="Neil Richter" />
|
||||||
@@ -34,6 +35,7 @@ props:
|
|||||||
size: md
|
size: md
|
||||||
slots:
|
slots:
|
||||||
default: |
|
default: |
|
||||||
|
|
||||||
<UAvatar src="https://avatars.githubusercontent.com/u/739984?v=4" alt="Benjamin Canac" />
|
<UAvatar src="https://avatars.githubusercontent.com/u/739984?v=4" alt="Benjamin Canac" />
|
||||||
<UAvatar src="https://avatars.githubusercontent.com/u/25613751?v=4" alt="Romain Hamel" />
|
<UAvatar src="https://avatars.githubusercontent.com/u/25613751?v=4" alt="Romain Hamel" />
|
||||||
<UAvatar src="https://avatars.githubusercontent.com/u/19751938?v=4" alt="Neil Richter" />
|
<UAvatar src="https://avatars.githubusercontent.com/u/19751938?v=4" alt="Neil Richter" />
|
||||||
|
|||||||
@@ -9,8 +9,87 @@ links:
|
|||||||
|
|
||||||
## Usage
|
## 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
|
## 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
|
## API
|
||||||
|
|
||||||
### Props
|
### Props
|
||||||
|
|||||||
@@ -122,9 +122,12 @@ export default defineNuxtConfig({
|
|||||||
'UAvatarGroup',
|
'UAvatarGroup',
|
||||||
'UBadge',
|
'UBadge',
|
||||||
'UButton',
|
'UButton',
|
||||||
|
'UButtonGroup',
|
||||||
'UIcon',
|
'UIcon',
|
||||||
|
'UInput',
|
||||||
'UKbd',
|
'UKbd',
|
||||||
'ULink'
|
'ULink',
|
||||||
|
'UProgress'
|
||||||
].includes(c.pascalName))
|
].includes(c.pascalName))
|
||||||
|
|
||||||
globals.forEach(c => c.global = 'sync')
|
globals.forEach(c => c.global = 'sync')
|
||||||
|
|||||||
Reference in New Issue
Block a user