import Elementary public struct LabeledContent: HTML { let body: Body let label: Label public init( @HTMLBuilder body: () -> Body, @HTMLBuilder label: () -> Label ) { self.body = body() self.label = label() } public var content: some HTML { div { label body } } } extension LabeledContent: Sendable where Label: Sendable, Body: Sendable {} // MARK: - Forms public extension LabeledContent where Label == InputLabel, Body == Input { init( label: String, input: () -> Body ) { self.init { input() } label: { InputLabel(for: input().id) { HTMLText(label) } } } } public extension LabeledContent where Label == InputLabel, Body == _AttributedElement { init( label: String, input: () -> Body ) { self.init { input() } label: { InputLabel(for: input().content.id) { HTMLText(label) } } } }