Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Supporting labels for VSCodeDropdown #461

@petrbroz

Description

@petrbroz

Feature request

Add support for specifying a label for the <VSCodeDropdown /> React component that will look the same as labels for other input elements. Or, if this is feature is already available, please document it.

Expected behavior

One should be able to specify a label on the <VSCodeDropdown /> React component, for example, like so:

<VSCodeDropdown value="e1" label="Engine:">
    <VSCodeOption value="e1">Engine 1</VSCodeOption>
    <VSCodeOption value="e2">Engine 2</VSCodeOption>
</VSCodeDropdown>

And the label should be styled in the same way as for other input elements such as <VSCodeTextField />.

Current behavior

AFAIK the only way of adding a label to the <VSCodeDropdown /> React component is like so:

<div>
    <label htmlFor="engine">Engine:</label>
    <VSCodeDropdown id="engine" value="e1">
        <VSCodeOption value="e1">Engine 1</VSCodeOption>
        <VSCodeOption value="e2">Engine 2</VSCodeOption>
    </VSCodeDropdown>
</div>

Unfortunately in this case the label's layout and style doesn't match the labels of other input elements, as indicated in the screenshot below:

Screenshot 2023-03-15 at 14 29 01

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions