What problem does this feature solve?
My team uses Ant Design for our component library. We use the Divider component in many places and we tend to override the gutter margin quite a bit using the style prop. As a team we've all mentioned that it would be nice and seems intuitive that the Divider component would have a prop similar to the orientationMargin
prop that would adjust the gutter margin.
What does the proposed API look like?
I propose adding a property to the Divider component called gutterMargin
This property would set the margin-inline
for vertical dividers and the margin
for horizontal dividers
2条答案
按热度按时间s4n0splo1#
Use
className
orstyle
directly. We only add style related prop when have not other way. Or recommend to useclassNames
className
rootClassName
styles
style
rootStyle
instead.5sxhfpxr2#
Thanks for the reply!
I think that is a great standard to have. I would argue that given that the functionality of the Divider component is the margin that it provides, I would argue that this could be an exception to that rule.
If not however, what would you think about exposing a component token for controlling the default gutter margin?
I see that we have two tokens in the styling for the horizontal Divider margin.
dividerHorizontalWithTextGutterMargin
anddividerHorizontalGutterMargin
We could expose these like we do the
verticalMarginInline
token for the vertical Divider in the documentation.