Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Antd Fixed Header In Layout

With ant.design, what is the right way to apply Affix to Header in a Layout so that it stays fixed at the top during scroll? Below is an example layout:

import { Layout } from 'antd';
const { Header, Footer, Sider, Content } = Layout;

ReactDOM.render(
<div>
  <Layout>
    <Header>Header</Header>
    <Layout>
      <Sider>Sider</Sider>
      <Content>Content</Content>
    </Layout>
    <Footer>Footer</Footer>
  </Layout>
</div>
, mountNode);
like image 904
cannin Avatar asked Feb 20 '17 13:02

cannin


1 Answers

The demo in @benjycui's anwser is published at ant.design site now: https://ant.design/components/layout/#components-layout-demo-fixed

like image 74
afc163 Avatar answered Oct 12 '22 20:10

afc163