ThemedSiderV2 component has static width values (200px expanded and 80px collapsed) that aren't directly configurable through props. As mentioned in a GitHub discussion:ThemedSiderV2 component to your project and then modify the width values.Sider prop of ThemedLayoutV2:render prop: For some UI frameworks, you can use the render prop of the ThemedSiderV2 component to customize the rendering while maintaining the core functionality:render prop is one approach to customize the sider width. This allows you to maintain the core functionality of the ThemedSiderV2 component while adjusting its width to your needs.render prop caused you to lose the styling. This is because the default styling is applied to the original Sider component structure, and when you wrap everything in a custom div, those styles aren't applied properly.@refinedev/antd) and choose ThemedLayoutV2 to swizzle. This will create the component files in your project where you can directly modify the width values.import { Refine } from "@refinedev/core";
import { ThemedLayoutV2 } from "@refinedev/antd"; // or your UI framework
import { CustomSider } from "./CustomSider";
const App: React.FC = () => {
return (
<Refine
// ...
>
<ThemedLayoutV2
Sider={() => <CustomSider />}
>
{/* ... */}
</ThemedLayoutV2>
</Refine>
);
};<ThemedLayoutV2
Sider={() => (
<ThemedSiderV2
render={({ items, logout, collapsed }) => {
return (
<div style={{ width: collapsed ? '120px' : '300px' }}>
{items}
{logout}
</div>
);
}}
/>
)}
>
{/* ... */}
</ThemedLayoutV2><ThemedSiderV2
render={({ items, logout, collapsed }) => {
return (
<div style={{ width: collapsed ? '120px' : '300px' }}>
{items}
{logout}
</div>
);
}}
/>import { ThemedLayoutV2 } from "@refinedev/antd";
import { ThemedSiderV2 } from "@components/layout/sider"; // Your customized sider
export default function Layout({ children }) {
return <ThemedLayoutV2 Sider={ThemedSiderV2}>{children}</ThemedLayoutV2>;
}