Skip to content

Commit 715dc4d

Browse files
committed
feat(CSidebar): add sizing variants
1 parent 7512f68 commit 715dc4d

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/components/sidebar/CSidebar.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ const CSidebar = defineComponent({
4949
}
5050
},
5151
},
52+
/**
53+
* Size the component small, large, or extra large.
54+
*/
55+
size: {
56+
type: String,
57+
default: undefined,
58+
validator: (value: string) => {
59+
return ['sm', 'lg', 'xl'].includes(value)
60+
},
61+
},
5262
/**
5363
* Expand narrowed sidebar on hover.
5464
*/
@@ -60,7 +70,10 @@ const CSidebar = defineComponent({
6070
/**
6171
* Toggle the visibility of sidebar component.
6272
*/
63-
visible: Boolean,
73+
visible: {
74+
type: Boolean,
75+
default: undefined,
76+
},
6477
},
6578
setup(props, { slots }) {
6679
return () =>
@@ -76,8 +89,10 @@ const CSidebar = defineComponent({
7689
[`sidebar-self-hiding${
7790
typeof props.selfHiding !== 'boolean' && '-' + props.selfHiding
7891
}`]: props.selfHiding,
92+
[`sidebar-${props.size}`]: props.size,
7993
'sidebar-narrow-unfoldable': props.unfoldable,
80-
show: props.visible,
94+
show: props.visible === true,
95+
hide: props.visible === false,
8196
},
8297
],
8398
},

0 commit comments

Comments
 (0)