Skip to content

A ​

Brief Introduction ​

The a link component is used to display hyperlink content, supporting various styles and interactive behaviors. You can use <MYa></MYa> or <MYa /> to implement a link component.

About Color Usage ​

type ​

Using type in MYa allows you to define the link's color. These colors are the basic color definitions provided by mengyue-components. For example, use type to complete the following color definitions. If type is not specified, the default is a blue link:

Code Demo
展开代码

Custom Color ​

If the default colors do not meet your needs, you can customize the color using the color attribute.

Code Demo
展开代码

About Interactive Behavior ​

disabled ​

Use the disabled attribute to disable the link.

Code Demo
展开代码

underline ​

Use the underline attribute to control the display of the link's underline.

Code Demo
展开代码

About Size ​

size ​

Use the size attribute to adjust the link size.

Code Demo
展开代码

Combined Usage ​

Finally, achieve combined usage of multiple APIs:

Code Demo
展开代码

Note: If the type attribute is used, please do not define the color attribute on the component, otherwise color will override type, and the color configuration will take effect.

API Reference ​

Props ​

ParameterDescriptionTypeOptional ValuesDefault
typeLink typestringprimary / success / warning / danger / info—
colorColorstringSupports hex colors or named colors—
disabledDisabledboolean—false
underlineUnderlineboolean—true
sizeSizestringmini / small / medium / large / custommedium
tagRender tagstringSupports all HTML tagsa

Type Definition ​

typescript
interface AProps {
  type?: string;
  color?: string;
  disabled?: boolean;
  underline?: boolean;
  size?: string;
  tag?: string;
}

Released under the MIT License.