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:
Custom Color
If the default colors do not meet your needs, you can customize the color using the color attribute.
About Interactive Behavior
disabled
Use the disabled attribute to disable the link.
underline
Use the underline attribute to control the display of the link's underline.
About Size
size
Use the size attribute to adjust the link size.
Combined Usage
Finally, achieve combined usage of multiple APIs:
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
| Parameter | Description | Type | Optional Values | Default |
|---|---|---|---|---|
| type | Link type | string | primary / success / warning / danger / info | — |
| color | Color | string | Supports hex colors or named colors | — |
| disabled | Disabled | boolean | — | false |
| underline | Underline | boolean | — | true |
| size | Size | string | mini / small / medium / large / custom | medium |
| tag | Render tag | string | Supports all HTML tags | a |
Type Definition
interface AProps {
type?: string;
color?: string;
disabled?: boolean;
underline?: boolean;
size?: string;
tag?: string;
}