Pane grid, resizable tiled panes.
Children are keyed by their node ID and rendered as individual panes.
The renderer manages an internal pane_grid::State cache.
Accessibility
The pane grid itself does not expose a semantic role to assistive
technology. To make the grid navigable by screen readers, wrap it
in a container with an explicit role and label:
container "editor-panes" do
a11y do
role :group
label "Editor panes"
end
pane_grid "grid", panes: ["left", "right"] do
text_input "left", model.left
text_input "right", model.right
end
endIndividual panes can carry their own a11y annotations for
further context (e.g., label describing each pane's purpose).
The pane_focus_cycle event (F6/Shift+F6) provides keyboard
navigation between panes.
Props
| Name | Type | Default | Description |
|---|---|---|---|
panes | [String.t() | atom()] | nil | List of pane identifiers. |
spacing | number() | nil | Space between panes in pixels. Default: 2. |
width | :fill | :shrink | {:fill_portion, pos_integer()} | number() | nil | Grid width. Default: fill. |
height | :fill | :shrink | {:fill_portion, pos_integer()} | number() | nil | Grid height. Default: fill. |
min_size | number() | nil | Minimum pane size in pixels. Default: 10. |
divider_color | String.t() | nil | Color for the split divider. |
divider_width | number() | nil | Divider thickness in pixels. |
leeway | number() | nil | Grabbable area around dividers in pixels. |
split_axis | :horizontal | :vertical | nil | Split axis for initial layout. |
event_rate | integer() | nil | Max events per second for coalescable events. |
a11y | %Plushie.Type.A11y{} | map() | keyword() | %{role: :group} | Accessibility annotations. |
Events
| Event | Type | Description |
|---|---|---|
:pane_clicked | none | Emitted when a pane is selected. |
:pane_resized | value: %{split: String.t() | atom(), ratio: number()} | Emitted when a split divider is moved. |
:pane_dragged | none | Emitted during pane drag operations. |
:pane_focus_cycle | none | Emitted on F6/Shift+F6 focus cycling. |
Summary
Functions
Accessibility annotations.
Converts this widget struct to a ui_node() map.
Color for the split divider.
Divider thickness in pixels.
Max events per second for coalescable events.
Appends multiple children to the widget.
Grid height. Default: fill.
Grabbable area around dividers in pixels.
Minimum pane size in pixels. Default: 10.
Creates a new widget struct with the given ID and keyword options.
Creates a :pane_grid widget.
Sets the list of pane identifiers. Atoms are coerced to strings.
Appends a child to the widget.
Space between panes in pixels. Default: 2.
Split axis for initial layout.
Grid width. Default: fill.
Applies keyword options to an existing widget struct.
Types
@type option() :: ((((((((({:panes, [String.t() | atom()]} | {:spacing, number()}) | {:width, :fill | :shrink | {:fill_portion, pos_integer()} | number()}) | {:height, :fill | :shrink | {:fill_portion, pos_integer()} | number()}) | {:min_size, number()}) | {:divider_color, atom() | String.t() | map()}) | {:divider_width, number()}) | {:leeway, number()}) | {:split_axis, :horizontal | :vertical}) | {:event_rate, integer()}) | {:a11y, %Plushie.Type.A11y{ active_descendant: term(), busy: term(), described_by: term(), description: term(), disabled: term(), error_message: term(), expanded: term(), has_popup: term(), hidden: term(), invalid: term(), label: term(), label_from: term(), labelled_by: term(), level: term(), live: term(), mnemonic: term(), modal: term(), orientation: term(), position_in_set: term(), radio_group: term(), read_only: term(), required: term(), role: term(), selected: term(), size_of_set: term(), toggled: term(), value: term() } | map() | keyword()}
@type t() :: %Plushie.Widget.PaneGrid{ a11y: (%Plushie.Type.A11y{ active_descendant: term(), busy: term(), described_by: term(), description: term(), disabled: term(), error_message: term(), expanded: term(), has_popup: term(), hidden: term(), invalid: term(), label: term(), label_from: term(), labelled_by: term(), level: term(), live: term(), mnemonic: term(), modal: term(), orientation: term(), position_in_set: term(), radio_group: term(), read_only: term(), required: term(), role: term(), selected: term(), size_of_set: term(), toggled: term(), value: term() } | map() | keyword()) | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, children: [Plushie.Widget.ui_node()], divider_color: String.t() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, divider_width: number() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, event_rate: integer() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, height: (:fill | :shrink | {:fill_portion, pos_integer()} | number()) | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, id: String.t(), leeway: number() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, min_size: number() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, panes: [String.t() | atom()] | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, spacing: number() | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, split_axis: (:horizontal | :vertical) | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil, width: (:fill | :shrink | {:fill_portion, pos_integer()} | number()) | Plushie.Animation.Transition.t() | Plushie.Animation.Spring.t() | Plushie.Animation.Sequence.t() | nil }
Functions
@spec a11y( widget :: t(), value :: (%Plushie.Type.A11y{ active_descendant: term(), busy: term(), described_by: term(), description: term(), disabled: term(), error_message: term(), expanded: term(), has_popup: term(), hidden: term(), invalid: term(), label: term(), label_from: term(), labelled_by: term(), level: term(), live: term(), mnemonic: term(), modal: term(), orientation: term(), position_in_set: term(), radio_group: term(), read_only: term(), required: term(), role: term(), selected: term(), size_of_set: term(), toggled: term(), value: term() } | map() | keyword()) | nil ) :: t()
Accessibility annotations.
Accepts %Plushie.Type.A11y{} | map() | keyword().
@spec build(widget :: t()) :: Plushie.Widget.ui_node()
Converts this widget struct to a ui_node() map.
Color for the split divider.
Accepts String.t().
Divider thickness in pixels.
Accepts number().
Max events per second for coalescable events.
Accepts integer().
@spec extend(widget :: t(), children :: [Plushie.Widget.child()]) :: t()
Appends multiple children to the widget.
@spec height( widget :: t(), value :: (:fill | :shrink | {:fill_portion, pos_integer()} | number()) | nil ) :: t()
Grid height. Default: fill.
Accepts :fill | :shrink | {:fill_portion, pos_integer()} | number().
Grabbable area around dividers in pixels.
Accepts number().
Minimum pane size in pixels. Default: 10.
Accepts number().
Creates a new widget struct with the given ID and keyword options.
Creates a :pane_grid widget.
Shorthand for new/2. Import this macro to use the widget name
directly in view functions:
import Plushie.Widget.PaneGrid, only: [pane_grid: 2]
pane_grid("my-id", prop: value)
Sets the list of pane identifiers. Atoms are coerced to strings.
@spec push(widget :: t(), child :: Plushie.Widget.child()) :: t()
Appends a child to the widget.
Space between panes in pixels. Default: 2.
Accepts number().
Split axis for initial layout.
Accepts :horizontal | :vertical.
@spec width( widget :: t(), value :: (:fill | :shrink | {:fill_portion, pos_integer()} | number()) | nil ) :: t()
Grid width. Default: fill.
Accepts :fill | :shrink | {:fill_portion, pos_integer()} | number().
Applies keyword options to an existing widget struct.