You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current Button components offer three stylistic options: "default," "minimal," and "outlined." Although these styles are mutually exclusive, their corresponding props, minimal and outlined, can both be applied simultaneously. This results in an overly complex API and can cause confusion and unintended styling conflicts. For instance, setting both minimal={true} and outlined={true} leads to the "outlined" styles overriding the "minimal" styles, which can be unintuitive for developers.
Proposal
We propose consolidating the minimal and outlined boolean props into a single enum prop named variant. The variant prop will accept the following values: "solid" (the default), "minimal", and "outlined".
typeButtonVariant="solid"|"minimal"|"outlined";
To implement this change:
Deprecate the minimal and outlined props, indicating their removal in a future major version.
Provide migration instructions and codemods to assist developers in updating their codebases.
Internally, the <Button> component will continue to use the same Classes.MINIMAL and Classes.OUTLINED classes, applied through the variant prop.
By unifying these styling options under the variant prop, we simplify the API and eliminate the possibility of mutually exclusive props being applied simultaneously. Setting "solid" as the default variant minimizes migration efforts, as existing buttons without the variant prop will maintain their current styling.
The following components also utilize the minimal prop. We need to determine whether these components should be updated for consistency with the proposed changes to the Button component, or if their minimal prop should remain unchanged:
ggdouglas
changed the title
Proposal: Consolidate "minimal" and "outlined" props on Button components
Proposal: Consolidate minimal and outlined props on Button components
Jan 29, 2025
Problem
The current Button components offer three stylistic options: "default," "minimal," and "outlined." Although these styles are mutually exclusive, their corresponding props,
minimal
andoutlined
, can both be applied simultaneously. This results in an overly complex API and can cause confusion and unintended styling conflicts. For instance, setting bothminimal={true}
andoutlined={true}
leads to the "outlined" styles overriding the "minimal" styles, which can be unintuitive for developers.Proposal
We propose consolidating the
minimal
andoutlined
boolean props into a single enum prop namedvariant
. Thevariant
prop will accept the following values:"solid"
(the default),"minimal"
, and"outlined"
.To implement this change:
minimal
andoutlined
props, indicating their removal in a future major version.<Button>
component will continue to use the sameClasses.MINIMAL
andClasses.OUTLINED
classes, applied through thevariant
prop.blueprint/packages/core/src/components/button/buttons.tsx
Lines 97 to 98 in 5d092cd
Examples:
Benefits
By unifying these styling options under the
variant
prop, we simplify the API and eliminate the possibility of mutually exclusive props being applied simultaneously. Setting "solid" as the default variant minimizes migration efforts, as existing buttons without thevariant
prop will maintain their current styling.Affected Components
<AnchorButton>
<Button>
<ButtonGroup>
Addendum
The following components also utilize the
minimal
prop. We need to determine whether these components should be updated for consistency with the proposed changes to the Button component, or if theirminimal
prop should remain unchanged:<Callout>
<DialogFooter>
<HTMLSelect>
<Popover>
<Tag>
/<CompoundTag>
The text was updated successfully, but these errors were encountered: