--- localeCode: en-US order: 11 category: Basic title: Layout subTitle: Layout icon: doc-layout dir: column brief: Assist in the overall layout of a page. --- ## Overview - `Layout`: Layout containers. You can nest `Header` `Sider` `Content` `Footer` or `Layout` itself inside. - `Header`: Head component, can only be used inside `Layout`. - `Sider`: Sidebar, can only be used inside `Layout`. - `Content`: Content component, can only be used inside `Layout`. - `Footer`: Footer component, can only be used inside `Layout`. > Note: Layout components are implemented with Flex layout. Browser compatibility may need to be considered. ## Demos ### How to import ```jsx import import { Layout } from '@douyinfe/semi-ui'; ``` ### Three-section Layout ```jsx live=true dir="column" hideInDSM import React from 'react'; import { Layout } from '@douyinfe/semi-ui'; () => { const { Header, Footer, Content } = Layout; return (
Header
Content
); }; ``` ### Left-sidebar Layout ```jsx live=true dir="column" hideInDSM import React from 'react'; import { Layout } from '@douyinfe/semi-ui'; () => { const { Header, Footer, Sider, Content } = Layout; return (
Header
Sider Content
); }; ``` ### Right-sidebar Layout ```jsx live=true dir="column" hideInDSM import React from 'react'; import { Layout } from '@douyinfe/semi-ui'; () => { const { Header, Footer, Sider, Content } = Layout; return (
Header
Content Sider
); }; ``` ### Sidebar Layout ```jsx live=true dir="column" hideInDSM import React from 'react'; import { Layout } from '@douyinfe/semi-ui'; () => { const { Header, Footer, Sider, Content } = Layout; return ( Sider
Header
Content
); }; ``` ### Responsive Layout Six response sizes are preset in the sidebar: `xs`,`sm`,`md`,`lg`,`xl`,`xxl`. You can use `breakpoint` to set breakpoints, and use `onBreakpoint` to call callback functions. ```jsx live=true dir="column" hideInDSM import React from 'react'; import { Layout } from '@douyinfe/semi-ui'; () => { const onbreakpoint = (screen, bool) => { console.log(screen, bool); }; const { Header, Footer, Sider, Content } = Layout; return (
Header
Sider Content
); }; ``` ## Layout Examples ### Top-nav Layout ```jsx live=true dir="column" hideInDSM import React from 'react'; import { Layout, Nav, Button, Breadcrumb, Skeleton, Avatar } from '@douyinfe/semi-ui'; import { IconSemiLogo, IconBell, IconHelpCircle, IconBytedanceLogo, IconHome, IconLive, IconSetting } from '@douyinfe/semi-icons'; () => { const { Header, Footer, Content } = Layout; return (
)} loading={true}>

Hi, Bytedance dance dance.

Hi, Bytedance dance dance.

); }; ``` ### Top-Nav SideBar Layout ```jsx live=true dir="column" hideInDSM import React from 'react'; import { Layout, Nav, Button, Breadcrumb, Skeleton, Avatar } from '@douyinfe/semi-ui'; import { IconSemiLogo, IconBell, IconHelpCircle, IconBytedanceLogo, IconHome, IconHistogram, IconLive, IconSetting } from '@douyinfe/semi-icons'; () => { const { Header, Footer, Sider, Content } = Layout; return (