How to add size classes for dashboard sidebar collapse icons #6770
|
Previously it had leadingIcon class in ui but now although it works but typescript gives error as in latest versions |
Replies: 1 comment 1 reply
|
The Two type-safe ways to do it. If you're fine with the whole button scaling, use <UDashboardSidebarCollapse size="xl" />If you only want the icon bigger, target it from <UDashboardSidebarCollapse class="[&>*]:size-5" />I'd stay away from |
The
uiprop onDashboardSidebarCollapseis typed as{ base?: any }because the component is a thin wrapper. Its own theme only hasbaseplus asidevariant, and everything else gets forwarded toUButtonwithv-bind. That's whyleadingIconstill works at runtime, it just isn't in the type anymore.Two type-safe ways to do it.
If you're fine with the whole button scaling, use
size. It's forwarded to the button, and the button theme bumps the icon along with it (size-4atsm,size-5atlg,size-6atxl):<UDashboardSidebarCollapse size="xl" />If you only want the icon bigger, target it from
classorui.base. The collapse button has no label, so the icon is its only child:<UDashboardSidebar…