Replies: 1 comment
-
|
Looking good, also allow it to be applied to the Toggle groups. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Button component improvements proposal
Draft of the component variants and props as CSS classes:
https://codepen.io/AlexBueno/pen/wvrZxER
Change prop
sizeChange current prop
sizesince the only effective change is the width control.Proposal for 3 sizes:
Fig. 1 - Proposed button sizes:
large,defaultandcompact.Large: cover the 44x44px target size recommended by the WCAG for pointer inputs.
Default: Regular size for multipurpose uses (Current size)
Compact: Use the button component:
The main changes are applied to the height and padding:
height: 48px,padding: 0 1.25remheight: 40px,padding: 0 1remheight: 32px,padding: 0 0.5remAdd prop
fillParent(currentfillParentbehavior inside thesizeprop)Fig. 2 - Inline and block button behaviors
The current property is mixing width fixed values with two properties that are intimately related to the type of display the component has, I propose replacing the current
small,mediumandlargewidth values, ending with a prop that allows the user switch between an inline behavior and a blocking behavior.inline-flexfillParentcan be abooleanattribute that when set totruedisplays the component as ablock(instead of changing the display, adding width of 100%)References
blockpropshouldFitContainerpropAdd prop
dangerFig. 3 - Danger button variants
Apart from the variants the component already has, a contextual
dangerstyle can be applied to each of them, meant to be used in destructive actions (e.g. delete or remove items)dangercan be abooleantype prop withfalseas the defaultBeta Was this translation helpful? Give feedback.
All reactions