Frame

A rectangular container that groups and lays out other widgets. Frame is the themed frame — it follows the active theme. For the classic frame with a direct background colour, see TkFrame.

Example

const card = app.Frame({ padding: 12 });
card.pack.configure({ fill: 'x', padx: 8, pady: 8 });

card.Label({ text: 'Settings' }).pack.configure({ anchor: 'w' });
card.Button({ text: 'Edit' }).pack.configure({ anchor: 'e' });

A frame is a container: create children with its factory methods (card.Label(…), card.Button(…), …) and lay them out inside it.

Options

Option Type Description
padding number / list Inner padding (one value, or [left, top, right, bottom]).
borderWidth number Border thickness.
relief string Border style: 'flat', 'groove', 'raised', …
width / height number Requested size in pixels.
style string A ttk style name (the default is TFrame).

The themed Frame has no background; for a solid colour fill use TkFrame.

Methods

Frame has no commands of its own; use the inherited widget methods plus the container factory methods. See Widget basics.

See also