value: str | Callable | None
value: str | Callable | None= None The HTMLPlus content to display. Only static HTMLPlus is rendered (e.g. no JavaScript. To render JavaScript, use the `js` or `head` parameters in the `Blocks` constructor). If a function is provided, the function will be called each time the app loads to set the initial value of this component.
label: str | I18nData | None
label: str | I18nData | None= None The label for this component. Is used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.
every: Timer | float | None
every: Timer | float | None= None Continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.
inputs: Component | Sequence[Component] | set[Component] | None
inputs: Component | Sequence[Component] | set[Component] | None= None Components that are used as inputs to calculate `value` if `value` is a function (has no effect otherwise). `value` is recalculated any time the inputs change.
show_label: bool
show_label: bool= False If True, the label will be displayed. If False, the label will be hidden.
visible: bool | Literal["hidden"]
visible: bool | Literal["hidden"]= True If False, component will be hidden. If "hidden", component will be visually hidden and not take up space in the layout but still exist in the DOM
elem_id: str | None
elem_id: str | None= None An optional string that is assigned as the id of this component in the HTMLPlus DOM. Can be used for targeting CSS styles.
elem_classes: list[str] | str | None
elem_classes: list[str] | str | None= None An optional list of strings that are assigned as the classes of this component in the HTMLPlus DOM. Can be used for targeting CSS styles.
render: bool
render: bool= True If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
key: int | str | tuple[int | str, ...] | None
key: int | str | tuple[int | str, ...] | None= None in a gr.render, Components with the same key across re-renders are treated as the same component, not a new component. Properties set in 'preserved_by_key' are not reset across a re-render.
preserved_by_key: list[str] | str | None
preserved_by_key: list[str] | str | None= "value" A list of parameters from this component's constructor. Inside a gr.render() function, if a component is re-rendered with the same key, these (and only these) parameters will be preserved in the UI (if they have been changed by the user or an event listener) instead of re-rendered based on the values provided during constructor.
min_height: int | None
min_height: int | None= None The minimum height of the component, specified in pixels if a number is passed, or in CSS units if a string is passed. If HTMLPlus content exceeds the height, the component will expand to fit the content.
max_height: int | None
max_height: int | None= None The maximum height of the component, specified in pixels if a number is passed, or in CSS units if a string is passed. If content exceeds the height, the component will scroll.
container: bool
container: bool= False If True, the HTMLPlus component will be displayed in a container. Default is False.
padding: bool
padding: bool= True If True, the HTMLPlus component will have a certain padding (set by the `--block-padding` CSS variable) in all directions. Default is True.
autoscroll: bool
autoscroll: bool= False If True, will automatically scroll to the bottom of the component when the content changes, unless the user has scrolled up. If False, will not scroll to the bottom when the content changes.
selectable_elements: List[str] | None
selectable_elements: List[str] | None= None A list of CSS selectors (e.g., ['tr', '.my-button']) for elements within the HTML that are selectable. When an element matching a selector is clicked, the `select` event is triggered. The event data will contain the selector that was matched and the data from the element.
change
changeTriggered when the value of the HTMLPlus changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.
click
clickTriggered when the HTMLPlus is clicked.
select
selectEvent listener for when the user selects or deselects the HTMLPlus. Uses event data gradio.SelectData to carry `value` referring to the label of the HTMLPlus, and `selected` to refer to state of the HTMLPlus. See EventData documentation on how to use this event data