Comments (7)
Not sure to understand.
In the title of the header, you're not using a text string, but a dom node? Is that the issue?
from react-mdl.
Exactly 👍
from react-mdl.
I think only strings are allowing based on the MDL spec, but we could probably allow node/component as well and assign the mdl-layout-title
class on it.
from react-mdl.
I'm not sure if it matters.
Users can just put some span
or strong
tag there or some complicated custom markup and I wouldn't restrict them.
I'm also not sure if mdl-layout-title
is necessary or not.
from react-mdl.
I have the same need where I just need to pass some markup instead of a string to the title
prop as I need to display two pieces of information, like: "Area / The Title", where I pass <span><span style={{ color: '#ddd' }}>Area / </span><strong>The Title</strong></span>
as the title. See a real example in the screenshot below.
The title
props in the Header
and HeaderRow
components just needs their propTypes changed to any
or specific types (string, number, element, node). That takes care of everything. We then could even pass it something like <span><Icon name="..." /> The Area Title</span>
.
This would be very useful and it would not impact anything else. The MDL specs never took the React way of coding into consideration and the need to pass components around that displays formatted text. I hope you will consider this.
Update: I would love to see the same done to CardTitle
which will make it so much more useful.
from react-mdl.
CardTitle
already accepts anything as a child, but in that case it won't use the default h2.mdl-card__title-text
.
The reason for that is because of the Event card in the demos: https://github.com/tleunen/react-mdl/blob/master/demo/card/card.js#L51-L57
from react-mdl.
That is fantastic Tommy. Thank you.
from react-mdl.
Related Issues (20)
- Library request on CDNJS HOT 3
- The prop `target` is marked as required in `Menu`
- React-MdL Dialog Not working in firefox and safari HOT 2
- Checkbox visibility
- Button ripple effect bug!?
- [TextField] Grey border-bottom doesn't disappear when field is clicked. Blue doesn't cover grey correctly. HOT 1
- DataTable: Is there any option to handle onSelectionChanged with out enabling selectable
- Should I use this project or react-toolbox? HOT 1
- Slider Tick Increments HOT 1
- Fix Circle CI and Codecov badges HOT 2
- [Typescript] Can you change this project to typescript ?
- [DataTable] accept nested objects in "rows" array HOT 1
- TypeError: Cannot read property 'upgradeElements' of undefined
- Where is the source code of react-mdl templates HOT 1
- how to get callback of click event on every single row in datatable
- Dialogs with input fields on mobile devices
- too many css files for WebStrom HOT 3
- 0
- Archive the repo? HOT 1
- "Uncaught Invariant Violation: Maximum update depth exceeded" in DataTable property onSelectionChanged Again
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-mdl.