Material-ui: [TableCell] Add `centered` as flag?

Created on 13 Nov 2017  路  7Comments  路  Source: mui-org/material-ui

We already have numeric for left alignment, it would be nice to have centered/center too as a quick flag as, I think, centering is quite a common requirement.

Table deprecation enhancement good first issue important

Most helpful comment

I think that it would be better to add an align property we have in the Typography component instead of a centered as flag:

align?: PropTypes.Alignment; // 'inherit', 'left', 'center', 'right', 'justify'

However, I'm wondering if we can't solve this problem with a generic helper that can be shared between the different core components.

All 7 comments

In that case, what about introducing an align property to replace the numeric one?

It certainly makes sense but my only concern is from a what is gained perspective.
I mean the usage would be align="left" or align="center" ... which is not far from "className={classes.center}" (from a keystroke perspective).
Maybe have 3 flags - left', center and right ?

Maybe have 3 flags - left', center and right ?

This introduces degree of freedom that can lead to unexpected behavior. Someone can set left and right at the same time without noticing. What should be the output in this case?

I have added the waiting for users upvotes tag. I'm closing the issue as I'm not sure people are looking for such abstraction. So please upvote this issue if you are. We will prioritize our effort based on the number of upvotes.

I agree with an align key. numeric can override the align key if necessary - or even be a value for align. "left", "center", "right", "numeric"

I think this feature is still worth adding in. I also agree that multiple boolean keys competing for priority doesn't make sense if we don't intend to be able use them at the same time. align="center" vs center is quite minor.

I think that it would be better to add an align property we have in the Typography component instead of a centered as flag:

align?: PropTypes.Alignment; // 'inherit', 'left', 'center', 'right', 'justify'

However, I'm wondering if we can't solve this problem with a generic helper that can be shared between the different core components.

@issuehuntfest has funded $40.00 to this issue. See it on IssueHunt

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FranBran picture FranBran  路  3Comments

ryanflorence picture ryanflorence  路  3Comments

ericraffin picture ericraffin  路  3Comments

revskill10 picture revskill10  路  3Comments

ghost picture ghost  路  3Comments