logoAnt Design

⌘ K
  • Design
  • Development
  • Components
  • Blog
  • Resources
5.25.4
  • Components Overview
  • General
    • Button
    • FloatButton
      5.0.0
    • Icon
    • Typography
  • Layout
    • Divider
    • Flex
      5.10.0
    • Grid
    • Layout
    • Space
    • Splitter
      5.21.0
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
    • Tabs
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPicker
      5.5.0
    • DatePicker
    • Form
    • Input
    • InputNumber
    • Mentions
    • Radio
    • Rate
    • Select
    • Slider
    • Switch
    • TimePicker
    • Transfer
    • TreeSelect
    • Upload
  • Data Display
    • Avatar
    • Badge
    • Calendar
    • Card
    • Carousel
    • Collapse
    • Descriptions
    • Empty
    • Image
    • List
    • Popover
    • QRCode
      5.1.0
    • Segmented
    • Statistic
    • Table
    • Tag
    • Timeline
    • Tooltip
    • Tour
      5.0.0
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
      5.1.0
  • Other
    • Affix
    • App
      5.1.0
    • ConfigProvider
    • Util
      5.13.0
Specification
Size
Interaction rules
Visualization rules
Component Overview
Examples
Basic Structure
Header-Content-Footer
Header-Sider
Header Sider 2
Sider
Custom trigger
Responsive
Fixed Header
Fixed Sider
API
Layout
Layout.Sider
Design Token

Layout

Handling the overall layout of a page.
Importimport { Layout } from "antd";
Sourcecomponents/layout
Docs
Edit this pageChangelog
contributors
  • GridSpace

    Resources

    Ant Design X
    Ant Design Charts
    Ant Design Pro
    Pro Components
    Ant Design Mobile
    Ant Design Mini
    Ant Design Web3
    Ant Design Landing-Landing Templates
    Scaffolds-Scaffold Market
    Umi-React Application Framework
    dumi-Component doc generator
    qiankun-Micro-Frontends Framework
    Ant Motion-Motion Solution
    China Mirror 🇨🇳

    Community

    Awesome Ant Design
    Medium
    Twitter
    yuque logoAnt Design in YuQue
    Ant Design in Zhihu
    Experience Cloud Blog
    seeconf logoSEE Conf-Experience Tech Conference

    Help

    GitHub
    Change Log
    FAQ
    Bug Report
    Issues
    Discussions
    StackOverflow
    SegmentFault

    Ant XTech logoMore Products

    yuque logoYuQue-Document Collaboration Platform
    AntV logoAntV-Data Visualization
    Egg logoEgg-Enterprise Node.js Framework
    Kitchen logoKitchen-Sketch Toolkit
    Galacean logoGalacean-Interactive Graphics Solution
    xtech logoAnt Financial Experience Tech
    Theme Editor
    Made with ❤ by
    Ant Group and Ant Design Community

    Specification

    Size

    The first level navigation is left aligned near a logo, and the secondary menu is right aligned.

    • Top Navigation: the height of the first level navigation is 64px, and the second level navigation is 48px.
    • Top Navigation (for landing pages): the height of the first level navigation is 80px, and the second level navigation is 56px.
    • Calculation formula of a top navigation: 48+8n.
    • Calculation formula of an aside navigation: 200+8n.

    Interaction rules

    • The first level navigation and the last level navigation should be distinguishable by visualization;
    • The current item should have the highest priority of visualization;
    • When the current navigation item is collapsed, the style of the current navigation item is applied to its parent level;
    • The left side navigation bar has support for both the accordion and expanding styles; you can choose the one that fits your case the best.

    Visualization rules

    Style of a navigation should conform to its level.

    • Emphasis by colorblock

      When the background color is a deep color, you can use this pattern for the parent level navigation item of the current page.

    • The highlight match stick

      When the background color is a light color, you can use this pattern for the current page navigation item; we recommend using it for the last item of the navigation path.

    • Highlighted font

      From the visualization aspect, a highlighted font is stronger than colorblock; this pattern is often used for the parent level of the current item.

    • Enlarge the size of the font

      12px, 14px is a standard font size of navigation's, 14px is used for the first and the second level of the navigation. You can choose an appropriate font size regarding the level of your navigation.

    Component Overview

    • Layout: The layout wrapper, in which Header Sider Content Footer or Layout itself can be nested, and can be placed in any parent container.
    • Header: The top layout with the default style, in which any element can be nested, and must be placed in Layout.
    • Sider: The sidebar with default style and basic functions, in which any element can be nested, and must be placed in Layout.
    • Content: The content layout with the default style, in which any element can be nested, and must be placed in Layout.
    • Footer: The bottom layout with the default style, in which any element can be nested, and must be placed in Layout.

    Based on flex layout, please pay attention to the compatibility.

    Examples

    API

    jsx
    <Layout>
    <Header>header</Header>
    <Layout>
    <Sider>left sidebar</Sider>
    <Content>main content</Content>
    <Sider>right sidebar</Sider>
    </Layout>
    <Footer>footer</Footer>
    </Layout>

    Layout

    Common props ref:Common props

    The wrapper.

    PropertyDescriptionTypeDefault
    classNameContainer classNamestring-
    hasSiderWhether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickeringboolean-
    styleTo customize the stylesCSSProperties-

    Layout.Sider

    The sidebar.

    PropertyDescriptionTypeDefault
    breakpointBreakpoints of the responsive layoutxs | sm | md | lg | xl | xxl-
    classNameContainer classNamestring-
    collapsedTo set the current statusboolean-
    collapsedWidthWidth of the collapsed sidebar, by setting to 0 a special trigger will appearnumber80
    collapsibleWhether can be collapsedbooleanfalse
    defaultCollapsedTo set the initial statusbooleanfalse
    reverseArrowReverse direction of arrow, for a sider that expands from the rightbooleanfalse
    styleTo customize the stylesCSSProperties-
    themeColor theme of the sidebarlight | darkdark
    triggerSpecify the customized trigger, set to null to hide the triggerReactNode-
    widthWidth of the sidebarnumber | string200
    zeroWidthTriggerStyleTo customize the styles of the special trigger that appears when collapsedWidth is 0object-
    onBreakpointThe callback function, executed when breakpoints changed(broken) => {}-
    onCollapseThe callback function, executed by clicking the trigger or activating the responsive layout(collapsed, type) => {}-

    breakpoint width

    js
    {
    xs: '480px',
    sm: '576px',
    md: '768px',
    lg: '992px',
    xl: '1200px',
    xxl: '1600px',
    }

    Design Token

    Component TokenHow to use?
    Token NameDescriptionTypeDefault Value
    bodyBgBackground Color of bodystring#f5f5f5
    footerBgBackground Color of footerstring#f5f5f5
    footerPaddingPadding of footerundefined | Padding<string | number>24px 50px
    headerBgBackground Color of headerstring#001529
    headerColorText color of headerstringrgba(0,0,0,0.88)
    headerHeightHeight of headerstring | number64
    headerPaddingPadding of headerundefined | Padding<string | number>0 50px
    lightSiderBgBackground Color of light theme siderstring#ffffff
    lightTriggerBgBackground Color of light theme sider triggerstring#ffffff
    lightTriggerColorColor of light theme sider triggerstringrgba(0,0,0,0.88)
    siderBgBackground Color of siderstring#001529
    triggerBgBackground Color of sider triggerstring#002140
    triggerColorColor of sider triggerstring#fff
    triggerHeightHeight of sider triggerstring | number48
    zeroTriggerHeightHeight of sider trigger when collapse is 0number40
    zeroTriggerWidthWidth of sider trigger when collapse is 0number40
    Global TokenHow to use?
    Sider

    Two-columns layout. The sider menu can be collapsed when horizontal space is limited.

    Generally, the mainnav is placed on the left side of the page, and the secondary menu is placed on the top of the working area. Contents will adapt the layout to the viewing area to improve the horizontal space usage, while the layout of the whole page is not stable.

    The level of the aside navigation is scalable. The first, second, and third level navigations could be present more fluently and relevantly, and aside navigation can be fixed, allowing the user to quickly switch and spot the current position, improving the user experience. However, this navigation occupies some horizontal space of the contents.

    CodeSandbox Icon
    codeblock
    codepen icon
    External Link Icon
    expand codeexpand code
    Fixed Header

    Sticky Header is generally used to fix the top navigation to facilitate page switching.

    CodeSandbox Icon
    codeblock
    codepen icon
    External Link Icon
    expand codeexpand code
    Fixed Sider

    When dealing with long content, a sticky sider can provide a better user experience.

    CodeSandbox Icon
    codeblock
    codepen icon
    External Link Icon
    expand codeexpand code
    Basic Structure

    Classic page layouts.

    CodeSandbox Icon
    codeblock
    codepen icon
    External Link Icon
    expand codeexpand code
    Header-Content-Footer

    The most basic "header-content-footer" layout.

    Generally, the mainnav is placed at the top of the page, and includes the logo, the first level navigation, and the secondary menu (users, settings, notifications) from left to right in it. We always put contents in a fixed size navigation (eg: 1200px), the layout of the whole page is stable, it's not affected by the viewing area.

    Top-bottom structure is conformed with the top-bottom viewing habit, it's a classical navigation pattern of websites. This pattern demonstrates efficiency in the main workarea, while using some vertical space. And because the horizontal space of the navigation is limited, this pattern is not suitable for cases when the first level navigation contains many elements or links.

    CodeSandbox Icon
    codeblock
    codepen icon
    External Link Icon
    expand codeexpand code
    Header-Sider

    Both the top navigation and the sidebar, commonly used in documentation site.

    CodeSandbox Icon
    codeblock
    codepen icon
    External Link Icon
    expand codeexpand code
    Header Sider 2

    Both the top navigation and the sidebar, commonly used in application site.

    CodeSandbox Icon
    codeblock
    codepen icon
    External Link Icon
    expand codeexpand code
    Custom trigger

    If you want to use a customized trigger, you can hide the default one by setting trigger={null}.

    CodeSandbox Icon
    codeblock
    codepen icon
    External Link Icon
    expand codeexpand code
    Responsive

    Layout.Sider supports responsive layout.

    Note: You can get a responsive layout by setting breakpoint, the Sider will collapse to the width of collapsedWidth when window width is below the breakpoint. And a special trigger will appear if the collapsedWidth is set to 0.

    CodeSandbox Icon
    codeblock
    codepen icon
    External Link Icon
    expand codeexpand code
    Header
    Content
    Footer
    Header
    Sider
    Content
    Footer
    Header
    Content
    Sider
    Footer
    Sider
    Header
    Content
    Footer
    • nav 1
    • nav 2
    • nav 3
    • nav 4
    • nav 5
    • nav 6
    • nav 7
    • nav 8
    • nav 9
    • nav 10
    • nav 11
    • nav 12
    • nav 13
    • nav 14
    • nav 15
    1. Home
    2. /
    3. List
    4. /
    5. App
    Content
    Ant Design ©2025 Created by Ant UED
    • nav 1
    • nav 2
    • nav 3
    1. Home
    2. /
    3. List
    4. /
    5. App
    • subnav 1
      • option1
      • option2
      • option3
      • option4
    • subnav 2
    • subnav 3
    Content
    Ant Design ©2025 Created by Ant UED
    • nav 1
    • nav 2
    • nav 3
    • subnav 1
      • option1
      • option2
      • option3
      • option4
    • subnav 2
    • subnav 3
    1. Home
    2. /
    3. List
    4. /
    5. App
    Content
    • nav 1
    • nav 2
    • nav 3
    Content
    • nav 1
    • nav 2
    • nav 3
    • nav 4
    content
    Ant Design ©2025 Created by Ant UED