Label: Label

LabelR Documentation



Labels give a name or title to a control or group of controls, including text fields, check boxes, combo boxes, radio buttons, and drop-down menus.

For more details and examples visit the official docs. The R package can not handle each and every case, so for advanced use cases you need to work using the original docs to achieve the desired result.





Props to pass to shiny.react::reactElement. See allowed props listed below in Details section


  • as IComponentAs<React.AllHTMLAttributes<HTMLElement>>
    Render the root element as another type.

  • componentRef IRefObject<ILabel>
    Optional callback to access the ILabel interface. Use this instead of ref for accessing the public methods and properties of the component.

  • disabled boolean
    Renders the label as disabled.

  • required boolean
    Whether the associated form field is required or not

  • styles IStyleFunctionOrObject<ILabelStyleProps, ILabelStyles>
    Styles for the label.

  • theme ITheme
    Theme provided by HOC.

Best practices


  • Labels should be close to the control they're paired with.


  • Labels should describe the purpose of the control.

  • Use sentence-style capitalization—only capitalize the first word. For more info, see Capitalization in the Microsoft Writing Style Guide.

  • Be short and concise.

  • Use nouns or short noun phrases.

  • Don't use labels as instructional text. For example, "Click to get started".



if (interactive()) {
    ui = Label("Required label", required = TRUE),
    server = function(input, output) {}

Appsilon/shiny.fluent documentation built on June 12, 2022, 2:41 a.m.