I want to have multiple FlatButton components in the Material-UI AppBar and preserve the style, so it looks like this (with multiple buttons).
However, when I try to add multiple FlatButton components, I get an error saying I need to wrap them in an enclosing tag. I've used both a span and a div with the same bad results.
Is there a way to either preserve the AppBar's style in the enclosing tag or a different way to add multiple elements to the AppBar itself to get the desired effect?
Often referred to as a NavBar, the AppBar will help you include page title, logo and navigation items to offer sleek, customizable app navigation. Part of the KendoReact library along with 100+ professional UI components built with React for React, from the ground up.
The iconRightElement must be a single element, so you just need to wrap your buttons in a div like this:
render() {
const buttonStyle = {
backgroundColor: 'transparent',
color: 'white'
};
const rightButtons = (
<div>
<FlatButton label="About" style={buttonStyle} />
<FlatButton label="Home" style={buttonStyle} />
</div>
);
return (
<AppBar title="React seed" iconRightElement={rightButtons} />
);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With