Giter VIP home page Giter VIP logo

Comments (4)

szimek avatar szimek commented on June 26, 2024 1

This works:

<header className="mdl-layout__header is-casting-shadow">
  <IconButton name="arrow_back" className="mdl-layout-icon" />
  <HeaderRow title={title}>
    ...     
  </HeaderRow>
</header>

@tleunen Thanks for this awesome library!

from react-mdl.

tleunen avatar tleunen commented on June 26, 2024

You can put whatever you want inside the Drawer component. So you can add your custom header if you want instead of using the Header component. (Which doesn't seem to be the case in this mdl example anyway).

from react-mdl.

szimek avatar szimek commented on June 26, 2024

@tleunen Hey, I've got similar question. I'd like to add a back button to the header:

<header class="mdl-layout__header">
  <button class="mdl-layout-icon mdl-button mdl-js-button mdl-button--icon">
    <i class="material-icons">arrow_back</i>
  </button>    
  <div class="mdl-layout__header-row">
    <span class="mdl-layout-title">Some title</span>
    <div class="mdl-layout-spacer"></div>
  </div>
</header>

I guess it's not possible with the current Header component? I can always use plain HTML, just asking :)

from react-mdl.

tleunen avatar tleunen commented on June 26, 2024

Everything you put in a <Header> will be wrap inside a HeaderRow, unless it's already a row, or a tab.
So with the current implementation, you cannot achieve exactly the same thing as what you describe, but you can have something quite similar I think using this:

const customTitle = <div><IconButton name="arrow_back" /> Some title</div>;
<Header title={customTitle} />

from react-mdl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.