DGT #1 Inputs with label inside input

From this:
Screenshot 2023-03-05 at 10.56.18 PM
To this:
Screenshot 2023-03-05 at 10.58.10 PM
with this:

dmc.Select(
    mt="md",
    styles={
        "root": {
            "position": "relative",
        },
        "input": {
            "height": 54,
            "paddingTop": 18,
        },
        "label": {
            "position": "absolute",
            "pointerEvents": "none",
            "fontSize": 11,
            "paddingLeft": 10,
            "paddingTop": 5,
            "zIndex": 1,
        },
    },
    data=["React", "Angular", "Svelte", "Vue"],
    placeholder="Pick one",
    w=300,
    label="Your favorite library",
)

Similarly you can get this:
Screenshot 2023-03-05 at 11.09.21 PM

I’m hoping to make it a series, this one being the first. Hopefully you guys will find these useful.

Check out: https://www.dash-mantine-components.com
Edit: Put this out as a medium blog as well: Customizing Dash Mantine Components using `styles` property | by Snehil Vijay | Mar, 2023 | Medium

Snehil

7 Likes

Amazing work, as always ! Thanks @snehilvj

1 Like