tuil
ReferenceComponentsTree

TreeProps

TreeProps component contract.

View rawEdit

Type

export interface TreeProps<TData = unknown>
  extends CommonComponentProps,
    SlottedComponentProps<
      TreeSlots,
      {
        readonly focused: boolean;
        readonly activeId?: string;
        readonly expanded: ReadonlySet<string>;
      }
    > {
  readonly items: readonly TreeItem<TData>[];
  readonly expandedIds?: readonly string[];
  readonly defaultExpandedIds?: readonly string[];
  readonly selectedId?: string;
  readonly defaultSelectedId?: string;
  readonly onExpandedChange?: (
    expanded: readonly string[],
  ) => void | Promise<void>;
  readonly onSelect?: (item: TreeItem<TData>) => void | Promise<void>;
  readonly height?: number;
  readonly staticLimit?: number;
  readonly autoFocus?: boolean;
}

Members

MemberTypeRequiredDescriptionRelated types
itemsreadonly TreeItem<TData>[]YesThe items member uses the readonly TreeItem<TData>[] contract.
expandedIdsreadonly string[] | undefinedNoThe expandedIds member uses the readonly string[] | undefined contract.
defaultExpandedIdsreadonly string[] | undefinedNoThe defaultExpandedIds member uses the readonly string[] | undefined contract.
selectedIdstring | undefinedNoThe selectedId member uses the string | undefined contract.
defaultSelectedIdstring | undefinedNoThe defaultSelectedId member uses the string | undefined contract.
onExpandedChange((expanded: readonly string[]) => void | Promise<void>) | undefinedNoThe onExpandedChange member uses the ((expanded: readonly string[]) => void | Promise<void>) | undefined contract.
onSelect((item: TreeItem<TData>) => void | Promise<void>) | undefinedNoThe onSelect member uses the ((item: TreeItem<TData>) => void | Promise<void>) | undefined contract.
heightnumber | undefinedNoThe height member uses the number | undefined contract.
staticLimitnumber | undefinedNoThe staticLimit member uses the number | undefined contract.
autoFocusboolean | undefinedNoThe autoFocus member uses the boolean | undefined contract.
variantstring | undefinedNoThe variant member uses the string | undefined contract.
size"sm" | "md" | "lg" | undefinedNoThe size member uses the "sm" | "md" | "lg" | undefined contract.
unstyledboolean | undefinedNoThe unstyled member uses the boolean | undefined contract.
classNamestring | undefinedNoThe className member uses the string | undefined contract.
layoutPartial<Omit<LayoutNodeInput, "children" | "id" | "semantics">> | undefinedNoThe layout member uses the Partial<Omit<LayoutNodeInput, "children" | "id" | "semantics">> | undefined contract.
idstring | undefinedNoThe id member uses the string | undefined contract.
testIdstring | undefinedNoThe testId member uses the string | undefined contract.
roleSemanticRole | undefinedNoThe role member uses the SemanticRole | undefined contract.SemanticRole
labelstring | undefinedNoThe label member uses the string | undefined contract.
descriptionstring | undefinedNoThe description member uses the string | undefined contract.
disabledboolean | undefinedNoThe disabled member uses the boolean | undefined contract.
readOnlyboolean | undefinedNoThe readOnly member uses the boolean | undefined contract.
selectedboolean | undefinedNoThe selected member uses the boolean | undefined contract.
checkedboolean | undefinedNoThe checked member uses the boolean | undefined contract.
expandedboolean | undefinedNoThe expanded member uses the boolean | undefined contract.
valueTextstring | undefinedNoThe valueText member uses the string | undefined contract.
slotsPartial<SlotComponents<&#123; root: import("ink").BoxProps; viewport: import("ink").BoxProps; item: import("ink").TextProps; empty: import("ink").TextProps; overflow: import("ink").TextProps; &#125;>> | undefinedNoThe slots member uses the Partial<SlotComponents<&#123; root: import("ink").BoxProps; viewport: import("ink").BoxProps; item: import("ink").TextProps; empty: import("ink").TextProps; overflow: import("ink").TextProps; &#125;>> | undefined contract.BoxProps, SlotComponents, TextProps
slotPropsPartial<SlotProps<&#123; root: import("ink").BoxProps; viewport: import("ink").BoxProps; item: import("ink").TextProps; empty: import("ink").TextProps; overflow: import("ink").TextProps; &#125;, &#123; readonly focused: boolean; readonly activeId?: string; readonly expanded: ReadonlySet<string>; &#125;>> | undefinedNoThe slotProps member uses the Partial<SlotProps<&#123; root: import("ink").BoxProps; viewport: import("ink").BoxProps; item: import("ink").TextProps; empty: import("ink").TextProps; overflow: import("ink").TextProps; &#125;, &#123; readonly focused: boolean; readonly activeId?: string; readonly expanded: ReadonlySet<string>; &#125;>> | undefined contract.BoxProps, SlotProps, TextProps

Source

View the secondary source reference

On this page