Usage
Using MYDS should be as simple as any other component library
Basic
Simply import the component & use it, like below!
Make sure to refer each Component's API to find out what is available.
Composition
MYDS components are built with composition in-mind. Composition offers customization at the lowest level, giving developers the highest level of freedom to implement their own logic on MYDS components.
Take a look at some of the following examples below:
A. Replace parent component
This example demonstrates how to override props to apply designated classes or event listeners through asChild
.
As a result, the <Link>
inherits the style of the <Button>
component while still functioning as a <Link>
!
B. Override props
This example demonstrates how a parent component can override the child component's props by acting like a wrapper.
In this case, the <ButtonIcon>
component applies the necessary CSS to <ArrowForward />
icon to make it compliant with the <Button>
component & the variant chosen.