In Subframe, you can customize components using two primary methods: props and slots:
onClick
, onChange
) or attributes (alt
, src
).Let’s compare two implementations of the <TrackCard />
component from the previous example.
Subcomponents can help further clarify intended usage by explicitly exposing slots and relevant props to the consumer of a component.
The <TrackCardWithSlots.FavoriteButton />
subcomponent is a good example of this in the example above.
When used in conjunction with Subcomponents, you can make sure that you expose all the necessary props and slots to the consumer of a component while making sure that the component is easy to use and understand.
In Subframe, you can customize components using two primary methods: props and slots:
onClick
, onChange
) or attributes (alt
, src
).Let’s compare two implementations of the <TrackCard />
component from the previous example.
Subcomponents can help further clarify intended usage by explicitly exposing slots and relevant props to the consumer of a component.
The <TrackCardWithSlots.FavoriteButton />
subcomponent is a good example of this in the example above.
When used in conjunction with Subcomponents, you can make sure that you expose all the necessary props and slots to the consumer of a component while making sure that the component is easy to use and understand.