ToolypetMCP
intermediate3 minutescss

Sidebar Navigation Layout

Build a responsive sidebar layout with CSS Grid, smooth width transition, and proper spacing.

sidebarlayoutgridresponsive

このレシピの使いどころ

Dashboard applications, admin panels, and documentation sites commonly use sidebar navigation. This creates a clean, responsive sidebar that can be toggled on mobile.

ステップ

1

Create the sidebar + main layout

プロンプト:Generate a CSS grid with 2 columns: 260px sidebar and 1fr main content, no gap
2

Box Shadow Generator

このツールを試す

Add subtle sidebar edge shadow

プロンプト:Generate a right-edge shadow for sidebar: 2px 0 8px rgba(0,0,0,0.06)
3

Smooth sidebar toggle animation

プロンプト:Generate a smooth cubic-bezier for 300ms width transition on sidebar collapse

よくある質問

How do I make the sidebar collapsible?

Toggle the grid-template-columns between '260px 1fr' and '60px 1fr' (icon-only mode). The transition will animate smoothly.

How do I handle the sidebar on mobile?

Use a CSS media query to change to a single column layout, and show the sidebar as an overlay with position: fixed.

関連レシピ