Skip to main content

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.

PropTypeDefaultDescription
hrefstringThe URL the link navigates to.
childrenReactNode / DashComponentThe content displayed inside the link.
targetstring"_self"Specifies where to display the linked document.
relstringSpecifies the relationship between the current document and the linked document.
sxobjectCustom styles using the Material-UI sx prop.
n_clicksnumber0The number of times the link has been clicked.
preventDefaultbooleanfalseIf 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:

MUI Link Documentation