Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf0ad650

Browse files
committed
feat(CButton): add support for unthemed outline and ghost buttons
1 parented1b8df commitf0ad650

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed

‎packages/coreui-vue/src/components/button/CButton.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ export const CButton = defineComponent({
9393
{
9494
class:[
9595
'btn',
96+
props.variant&&props.color ?`btn-${props.variant}-${props.color}` :`btn-${props.variant}`,
9697
{
9798
[`btn-${props.color}`]:props.color&&!props.variant,
98-
[`btn-${props.variant}-${props.color}`]:props.color&&props.variant,
9999
[`btn-${props.size}`]:props.size,
100100
active:props.active,
101101
disabled:props.disabled,

‎packages/docs/components/button.md‎

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,27 @@ If you're using `<CButton>` component as `<a>` elements that are used to trigger
6363

6464
##Outline buttons
6565

66-
If you need a button, but without the strong background colors. Set`variant="outline"` prop to remove all background colors.
66+
###Base outline style
67+
68+
The`variant="outline` property provides a neutral outline button style without any color modifiers. It’s useful as a foundation for minimal buttons without background color or strong visual emphasis.
69+
70+
::: demo
71+
<CButtonvariant="outline">Base outline button</CButton>
72+
<CButtonvariant="outline"active>Active state</CButton>
73+
<CButtonvariant="outline"disabled>Disabled state</CButton>
74+
:::
75+
```vue
76+
<CButton variant="outline">Base outline button</CButton>
77+
<CButton variant="outline" active>Active state</CButton>
78+
<CButton variant="outline" disabled>Disabled state</CButton>
79+
```
80+
81+
These Vue buttons use a transparent background, subtle border, and inherit text color from the parent context. They’re best suited for minimalist UI elements like modals, toolbars, or secondary actions.
82+
83+
84+
###Themed outline variants
85+
86+
If you need a button, but without the strong background colors, set`color` and`variant=" outline"` props to remove all background colors.
6787

6888
::: demo
6989
<CButtoncolor="primary"variant="outline">Primary</CButton>
@@ -86,10 +106,31 @@ If you need a button, but without the strong background colors. Set `variant="ou
86106
<CButton color="dark" variant="outline">Dark</CButton>
87107
```
88108

109+
These outline variants of our Vue.js buttons retain transparent backgrounds by default, but display a background tint on hover or focus to indicate interactivity. They’re ideal for secondary actions when you want to differentiate from the standard buttons visually.
110+
89111
##Ghost buttons
90112

113+
###Base ghost style
114+
115+
Use the`variant="ghost"` property to create ultra-minimalist buttons with no borders and a fully transparent background. These Vue buttons rely solely on text color for visibility and apply a background highlight when hovered over or in an active state.
116+
117+
They’re perfect for interfaces where you want buttons to be present but visually unobtrusive—such as action buttons in modals, cards, or toolbars.
118+
91119
If you need a ghost variant of button, set`variant="ghost"` prop to remove all background colors.
92120

121+
::: demo
122+
<CButtonvariant="ghost">Base ghost button</CButton>
123+
<CButtonvariant="ghost"active>Active state</CButton>
124+
<CButtonvariant="ghost"disabled>Disabled state</CButton>
125+
:::
126+
```vue
127+
<CButton variant="ghost">Base ghost button</CButton>
128+
<CButton variant="ghost" active>Active state</CButton>
129+
<CButton variant="ghost" disabled>Disabled state</CButton>
130+
```
131+
132+
To apply theme colors to Vue ghost buttons, use the`color` and`variant="ghost"` properties. By default, these variants color only the text. On hover or focus, they add a background that corresponds to the theme color.
133+
93134
::: demo
94135
<CButtoncolor="primary"variant="ghost">Primary</CButton>
95136
<CButtoncolor="secondary"variant="ghost">Secondary</CButton>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp