value: str | Path | Callable | None
value: str | Path | Callable | None
= None
The directory path to show as "selected" when the component is first loaded. If a callable is provided, it will be called when the app loads to set the initial value.
root_dir: str | Path
root_dir: str | Path
= "."
Path to the root directory from which to browse folders. If not provided, defaults to the current working directory. Raises ValueError if the directory does not exist or is not a directory.
label: str | I18nData | None
label: str | I18nData | None
= None
The label for this component. Appears above the component and is also 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 | None
show_label: bool | None
= None
If True, will display the label.
container: bool
container: bool
= True
If True, will place the component in a container, providing some extra padding around the border.
scale: int | None
scale: int | None
= None
Relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer.
min_width: int
min_width: int
= 160
Minimum pixel width, will wrap if not sufficient screen space to satisfy this value.
height: int | str | None
height: int | str | None
= None
The height of the component, specified in pixels if a number is passed, or in CSS units if a string is passed.
max_height: int | str | None
max_height: int | str | None
= 500
The maximum height of the component.
min_height: int | str | None
min_height: int | str | None
= None
The minimum height of the component.
interactive: bool | None
interactive: bool | None
= None
If True, will allow users to select a folder; if False, will only display the folder structure.
visible: bool | Literal["hidden"]
visible: bool | Literal["hidden"]
= True
If False, component will be hidden. If "hidden", component will be visually hidden 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 HTML DOM.
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 HTML DOM.
render: bool
render: bool
= True
If False, component will not 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.
preserved_by_key: list[str] | str | None
preserved_by_key: list[str] | str | None
= "value"
A list of parameters from this component's constructor. If a component is re-rendered with the same key, these parameters will be preserved in the UI.
change
change