Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(NcButton): Improve alignment documentation to show all variants. #4392

Merged
merged 1 commit into from Aug 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
56 changes: 42 additions & 14 deletions src/components/NcButton/NcButton.vue
Expand Up @@ -202,20 +202,48 @@ Sometimes it is required to change the icon alignment on the button, like for sw

```vue
<template>
<div>
<div style="display: flex; flex-direction: column; gap: 12px;">
<NcButton aria-label="center (default)" type="secondary" wide>
<template #icon>
<IconLeft :size="20" />
</template>
center (default)
</NcButton>
<NcButton alignment="center-reverse" aria-label="center-reverse" type="secondary" wide>
<template #icon>
<IconRight :size="20" />
</template>
center-reverse
</NcButton>
<div style="display: flex; gap: 12px;">
<NcButton aria-label="Previous" type="tertiary">
<template #icon>
<IconLeft :size="20" />
</template>
Previous page
</NcButton>
<NcButton alignment="end-reverse" aria-label="Previous" type="primary">
<template #icon>
<IconRight :size="20" />
</template>
Next page
</NcButton>
<div style="display: flex; flex-direction: column; gap: 12px; flex: 1">
<NcButton alignment="start" aria-label="start" type="secondary" wide>
<template #icon>
<IconLeft :size="20" />
</template>
start
</NcButton>
<NcButton alignment="start-reverse" aria-label="start-reverse" type="secondary" wide>
<template #icon>
<IconRight :size="20" />
</template>
start-reverse
</NcButton>
</div>
<div style="display: flex; flex-direction: column; gap: 12px; flex: 1">
<NcButton alignment="end" aria-label="end" type="secondary" wide>
<template #icon>
<IconLeft :size="20" />
</template>
end
</NcButton>
<NcButton alignment="end-reverse" aria-label="end-reverse" type="secondary" wide>
<template #icon>
<IconRight :size="20" />
</template>
end-reverse
</NcButton>
</div>
</div>
</div>
</template>
Expand Down Expand Up @@ -307,7 +335,7 @@ export default {
alignment: {
type: String,
default: 'center',
validator: (alignment) => ['start', 'start-reverse', 'center', 'end', 'end-reverse'].includes(alignment),
validator: (alignment) => ['start', 'start-reverse', 'center', 'center-reverse', 'end', 'end-reverse'].includes(alignment),
},

/**
Expand Down