-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decide on convention of type
, kind
, and variant
for v11
#9623
Comments
type
, kind
, and variant
for v11
|
Figma Research OverviewFigma uses a term called a Component Set to describe a collection of components, called variants, that all share their properties. However, the variants will have different combinations of values for these properties. A Property is the name of some variable aspect of a component. For example, the property names of a button component could be the A Property value is the different options available for a property. For example, the state property for a button could have To recap, a Component Set is made up of Variants. A Variant is a unique combination of properties and their values. Deep DiveA Component Set could be one-dimensional. For example, a Our Button Component Set, in this case, would contain the following variants: In this case, the variants are specifically:
A Component Set could also be multi-dimensional. For example, a In this case, the variants are:
Note: all variants within the component set will use the same properties and values, but each variant needs to be a unique combination of them. You don’t need to have a component for every possible combination of properties and values. BackgroundWe would like to standardize on terms used to describe components and how they change between visual appearance and behavior. Examples of this include:
Industry AnalysisDesign Systems
ConclusionThe recommendation is to use the variant terminology based on Figma along with the If a component has both visual AND behavior differences, then we create distinct components based on the behavior. For example, a notification has two different behaviors for toast and inline. These would become two distinct components, Links & Resources
Definitions
|
Figma Research (Migration) An interesting aspect of: https://help.figma.com/hc/en-us/articles/360056440594-Create-and-use-variants#Manage_variants is that the default name of the first property when creating variants will be: variant. They also show renaming this automatic field to |
Great stuff! Thanks for putting in the time researching. Do we have any idea how many components might need to be renamed ala Notification? I'm wary of using a totally new component for a thing that could be a prop, but agree it makes sense in some cases. I might have missed it, but if we use type for primary, secondary etc. how does a dev pass in the native "type" attribute? |
I still worry about the term
Type (variant) and type (text) can be seen a lot on the same page through out component docs. I could be more ok with type if we labeled it "Component type" instead of just "type" by itself. |
@vpicone thankfully no name changes! And for ambiguity, I think we'll need to have a prop like @aagonzales totally agreed |
Another factor that we should consider is how these terms are being used in the ecosystem. This is what teams are using in their docs (not sure if its the same in their code). |
@aagonzales here's one attempt at thinking about it:
I think when we have items inside of a component it could fall under the umbrella of component composition versus types/variants of a component. The guidance then becomes around the types of content a component allows versus it being a variant distinction. |
Background
We would like to be consistent in our terminology with how a user can configure a component to render differently in terms of appearance. In our codebase currently, we use several style of props to indicate that a component can have different visual appearances, including:
type
kind
In this proposal, we would like to define what the exact term used must be for components and when to use these other prop names, if at all.
Links & Resources
variant
The text was updated successfully, but these errors were encountered: