melt
Version:
The next generation of Melt UI. Built for Svelte 5.
52 lines (51 loc) • 1.45 kB
TypeScript
import type { MaybeGetter } from "../types";
export type CollapsibleProps = {
/**
* Whether the collapsible is disabled which prevents it from being opened.
*/
disabled?: MaybeGetter<boolean | undefined>;
/**
* Whether the collapsible is open.
*/
open?: MaybeGetter<boolean | undefined>;
/**
* A callback called when the value of `open` changes.
*/
onOpenChange?: (value: boolean) => void;
};
export declare class Collapsible {
#private;
readonly disabled: boolean;
ids: {
trigger: string;
content: string;
};
constructor(props?: CollapsibleProps);
/**
* The open state of the collapsible.
*/
get open(): boolean;
set open(open: boolean);
/**
* The spread attributes for the trigger button.
*/
get trigger(): {
readonly disabled: boolean;
readonly onclick: () => void;
readonly "data-state": string;
readonly "data-disabled": "" | undefined;
readonly "data-melt-collapsible-trigger": "";
readonly id: string;
readonly "aria-expanded": boolean;
readonly "aria-controls": string;
};
/**
* The spread attributes for the content element.
*/
get content(): {
readonly "data-state": string;
readonly "data-disabled": "" | undefined;
readonly "data-melt-collapsible-content": "";
readonly id: string;
};
}