Link
The Link component is used for navigation and styled links. It can be integrated with external URLs or internal routes, providing a consistent design and behavior.
import dash
from dash import html
import yipit_dash_mui_components as dmc
dash._dash_renderer._set_react_version('18.2.0')
app = dash.Dash(__name__)
app.layout = dmc.YipitMUIProvider(
children=[
html.Div([
dmc.Link(
href="https://example.com",
children="Example Link",
target="_blank",
rel="noopener",
sx={"color": "blue", "textDecoration": "underline"}
)
])
]
)
if __name__ == "__main__":
app.run_server(debug=True)
Props Table
Below are the main props available for the Link component.
| Prop | Type | Default | Description |
|---|---|---|---|
| href | string | The URL the link navigates to. | |
| children | ReactNode / DashComponent | The content displayed inside the link. | |
| target | string | "_self" | Specifies where to display the linked document. |
| rel | string | Specifies the relationship between the current document and the linked document. | |
| sx | object | Custom styles using the Material-UI sx prop. | |
| n_clicks | number | 0 | The number of times the link has been clicked. |
| preventDefault | boolean | false | If true, the default action of the link will be prevented. |
For the full list of props, refer to the official MUI documentation, as this component is based on MUI: