class
UI::DisclosureGroup
- UI::DisclosureGroup
- UI::View
- Reference
- Object
Overview
DisclosureGroup renders a HIG-compliant disclosure control: a header row with a rotating chevron/triangle that reveals or hides a block of content.
HIG defines two disclosure control shapes:
- Disclosure triangle (NSButton.BezelStyle.disclosure): used inline in lists and outlines. Points right (leading edge) when collapsed, down when expanded.
- Disclosure button (NSButton.BezelStyle.pushDisclosure): used in dialogs (e.g. the macOS Save sheet "Show More" button). Points down when content is hidden, up when visible.
On macOS the header row emits a real NSButton with bezelStyle=disclosure (5) followed by an optional visible content block when expanded = true. On iOS DisclosureGroup maps to SwiftUI DisclosureGroup or a UIButton row with a chevron SF Symbol ("chevron.right" when collapsed, "chevron.down" when expanded). Both are rendered inline for validation captures (static; no interactivity needed for visual validation).
Usage: group = UI::DisclosureGroup.new("Advanced Options", expanded: false) group.content << UI::Label.new("Item A") group.content << UI::Label.new("Item B")
Defined in:
ui/views/disclosure_group.crConstructors
Instance Method Summary
-
#accept(visitor : PlatformVisitor)
Accept a platform visitor for rendering dispatch.
-
#accessibility_label : String | Nil
Accessibility label for the header row (required for HIG compliance).
-
#accessibility_label=(accessibility_label : String | Nil)
Accessibility label for the header row (required for HIG compliance).
-
#content : Array(View)
Child views shown when expanded = true.
-
#content=(content : Array(View))
Child views shown when expanded = true.
-
#expanded : Bool
Whether the content block is revealed.
-
#expanded=(expanded : Bool)
Whether the content block is revealed.
-
#title : String
Header label shown beside the disclosure triangle/chevron.
-
#title=(title : String)
Header label shown beside the disclosure triangle/chevron.
Instance methods inherited from class UI::View
accept(visitor : PlatformVisitor)
accept,
accessibility_label : String | Nil
accessibility_label,
accessibility_label=(accessibility_label : String | Nil)
accessibility_label=,
background : Color | Nil
background,
background=(background : Color | Nil)
background=,
blur_radius : Float64
blur_radius,
blur_radius=(blur_radius : Float64)
blur_radius=,
border_color : Color | Nil
border_color,
border_color=(border_color : Color | Nil)
border_color=,
border_width : Float64
border_width,
border_width=(border_width : Float64)
border_width=,
clip_to_bounds : Bool
clip_to_bounds,
clip_to_bounds=(clip_to_bounds : Bool)
clip_to_bounds=,
container_query(name : String) : self
container_query,
container_query_name : String | Nil
container_query_name,
container_query_name=(container_query_name : String | Nil)
container_query_name=,
corner_radius : Float64
corner_radius,
corner_radius=(corner_radius : Float64)
corner_radius=,
fill_screen! : self
fill_screen!,
fluid_height(min : String | Number, ideal : String | Number, max : String | Number) : selffluid_height : UI::Fluid | Nil fluid_height, fluid_height=(fluid_height : UI::Fluid | Nil) fluid_height=, fluid_width(min : String | Number, ideal : String | Number, max : String | Number) : self
fluid_width : UI::Fluid | Nil fluid_width, fluid_width=(fluid_width : UI::Fluid | Nil) fluid_width=, hidden : Bool hidden, hidden=(hidden : Bool) hidden=, id : String | Nil id, id=(id : String | Nil) id=, maximum_height : Float64 | Nil maximum_height, maximum_height=(maximum_height : Float64 | Nil) maximum_height=, maximum_width : Float64 | Nil maximum_width, maximum_width=(maximum_width : Float64 | Nil) maximum_width=, minimum_height : Float64 | Nil minimum_height, minimum_height=(minimum_height : Float64 | Nil) minimum_height=, minimum_width : Float64 | Nil minimum_width, minimum_width=(minimum_width : Float64 | Nil) minimum_width=, opacity : Float64 opacity, opacity=(opacity : Float64) opacity=, padding : EdgeInsets padding, padding=(padding : EdgeInsets) padding=, root_fill : Bool root_fill, root_fill=(root_fill : Bool) root_fill=, shadow_color : Color | Nil shadow_color, shadow_color=(shadow_color : Color | Nil) shadow_color=, shadow_offset_x : Float64 shadow_offset_x, shadow_offset_x=(shadow_offset_x : Float64) shadow_offset_x=, shadow_offset_y : Float64 shadow_offset_y, shadow_offset_y=(shadow_offset_y : Float64) shadow_offset_y=, shadow_radius : Float64 shadow_radius, shadow_radius=(shadow_radius : Float64) shadow_radius=, swiftkit_state_handle : Pointer(Void) | Nil swiftkit_state_handle, swiftkit_state_handle=(swiftkit_state_handle : Pointer(Void) | Nil) swiftkit_state_handle=, test_id : String | Nil test_id, test_id=(test_id : String | Nil) test_id=
Constructor Detail
Instance Method Detail
Accept a platform visitor for rendering dispatch.
Each concrete view type calls visitor.visit(self).
Accessibility label for the header row (required for HIG compliance). Defaults to title + state if not set explicitly.
Accessibility label for the header row (required for HIG compliance). Defaults to title + state if not set explicitly.
Whether the content block is revealed. Controls triangle/chevron direction and child content visibility.
Whether the content block is revealed. Controls triangle/chevron direction and child content visibility.