diff --git a/include/ftxui/dom/elements.hpp b/include/ftxui/dom/elements.hpp
index 721674affbb0a44968c5cbcf36673fffd5d14902..b2d1b8b7eb47e0df4ce55de1b52c90fd2bb05fb2 100644
--- a/include/ftxui/dom/elements.hpp
+++ b/include/ftxui/dom/elements.hpp
@@ -80,7 +80,9 @@ Decorator borderStyled(BorderStyle);
 Decorator borderStyled(BorderStyle, Color);
 Decorator borderStyled(Color);
 Decorator borderWith(const Pixel&);
-Element window(Element title, Element content);
+Element window(Element title,
+               Element content,
+               BorderStyle border = ROUNDED);
 Element spinner(int charset_index, size_t image_index);
 Element paragraph(const std::string& text);
 Element paragraphAlignLeft(const std::string& text);
diff --git a/src/ftxui/dom/border.cpp b/src/ftxui/dom/border.cpp
index 9767f81108056321cc8cdfa0c54de7ebb5a7c46b..5616a560368b0097e45d85df0d1179ecc0947088 100644
--- a/src/ftxui/dom/border.cpp
+++ b/src/ftxui/dom/border.cpp
@@ -479,6 +479,7 @@ Element borderEmpty(Element child) {
 /// @brief Draw window with a title and a border around the element.
 /// @param title The title of the window.
 /// @param content The element to be wrapped.
+/// @param border The style of the border. Default is ROUNDED.
 /// @ingroup dom
 /// @see border
 ///
@@ -488,6 +489,12 @@ Element borderEmpty(Element child) {
 /// Element document = window(text("Title"),
 ///                           text("content")
 ///                    );
+///
+/// // With specifying border
+/// Element document = window(text("Title"),
+///                           text("content"),
+///                           ROUNDED
+///                    );
 /// ```
 ///
 /// ### Output
@@ -497,8 +504,8 @@ Element borderEmpty(Element child) {
 /// │content│
 /// └───────┘
 /// ```
-Element window(Element title, Element content) {
+Element window(Element title, Element content, BorderStyle border) {
   return std::make_shared<Border>(unpack(std::move(content), std::move(title)),
-                                  ROUNDED);
+                                  border);
 }
 }  // namespace ftxui