mskocik / svelty-picker

Simple date & time picker in svelte
https://mskocik.github.io/svelty-picker/
202 stars 46 forks source link

Set Label for input element #135

Closed mugu-fatman closed 1 year ago

mugu-fatman commented 1 year ago

How to set the label for input element, tried to using name property but doesn't work or I don't want to use placeholder. "DateTime-local" should be displayed on top of the input

image

mskocik commented 1 year ago

It's up to you. Because SveltyPicker is just wrapped in <span> element, you can use any HTML you want

mugu-fatman commented 1 year ago

Sorry Probably I was not clear with my question , I was able to add Due Date label to SveltyPicker , but I would need something like the input fields Reporter and Assignee as shown below Thanks

image

mskocik commented 1 year ago

And how does the markup looks for those Reporter, Assignee inputs?

mugu-fatman commented 1 year ago
Textfield is from SMUI         
        <Cell {span}>
            <Textfield 
                label={$i18n.t("task:reporter")}    
                value={reporter}
                disabled={true}
                {variant}
            />
        </Cell>
        <Cell {span}>
            <Textfield 
                label={$i18n.t("task:assignee")}
                value={assignee}
                {variant}
            />
        </Cell>
mskocik commented 1 year ago

Then you must recreate the same logic by providing custom content for inputs slot. Check docs for slots for more info and example.

mugu-fatman commented 1 year ago

Then you must recreate the same logic by providing custom content for inputs slot. Check docs for slots for more info and example.

Thanks