Reputation: 331
I am making a dashboard using Dash by Plotly. It is really fast and useful for me. But I could not find how can i arrange the location of for example a button. For example i want button to be x=5, y=150. But I could not find a solution on documentation. Additionally I examined the dash core components in github and I can not find somewhere like x coordinates or location etc. Do I need to add react.js codes somehow? Thanks in advance.
Upvotes: 0
Views: 1367
Reputation: 226
I'm assuming that you don't mean to create your entire layout this way and just want to place a particular button at your desired x and y.
You can use the Affix component that comes with dash-mantine-components.
PS: I'm the author of this library.
import dash_mantine_components as dmc
from dash import Dash, html
app = Dash(__name__)
app.layout = html.Div(
[
dmc.Affix(
dmc.Button("I'm in an affix component!"), position={"top": 5, "left": 150}
)
]
)
if __name__ == "__main__":
app.run_server(debug=True)
Upvotes: 1